home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / MANUALS / BLAUKOPF / CPP / C++
Unknown  |  1996-08-29  |  23.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default
100% gt2 Kopftext: 'HELP(' default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 48 45 4c 50 28 00 00 00 | c9 00 00 00 ff ff ff ff |HELP(...|........|
|00000010| 2c 00 00 00 00 fd ff ff | 00 00 00 00 e4 00 00 00 |,.......|........|
|00000020| 00 01 00 00 00 00 00 00 | 24 00 00 00 44 49 52 24 |........|$...DIR$|
|00000030| ec 00 00 00 ec 00 00 00 | 18 01 00 00 46 fd ff ff |........|....F...|
|00000040| 1c 4d f3 d2 71 05 00 00 | 13 00 00 00 00 00 00 00 |.M..q...|........|
|00000050| 21 52 6f 6f 74 00 00 00 | 8c 06 00 00 47 fd ff ff |!Root...|....G...|
|00000060| 55 e5 f5 04 24 01 00 00 | 13 01 00 00 00 00 00 00 |U...$...|........|
|00000070| 5b 61 2d 63 5d 00 00 00 | a4 16 00 00 47 fd ff ff |[a-c]...|....G...|
|00000080| a4 e5 f5 04 70 00 00 00 | 13 01 00 00 00 00 00 00 |....p...|........|
|00000090| 5b 64 2d 66 5d 00 00 00 | 9c 1b 00 00 47 fd ff ff |[d-f]...|....G...|
|000000a0| c8 e5 f5 04 ac 00 00 00 | 13 01 00 00 00 00 00 00 |........|........|
|000000b0| 5b 67 2d 6a 5d 00 00 00 | 94 24 00 00 47 fd ff ff |[g-j]...|.$..G...|
|000000c0| 0e e6 f5 04 8c 00 00 00 | 13 01 00 00 00 00 00 00 |........|........|
|000000d0| 5b 6b 2d 6f 5d 00 00 00 | 2c 2e 00 00 47 fd ff ff |[k-o]...|,...G...|
|000000e0| 43 e6 f5 04 ac 01 00 00 | 13 01 00 00 00 00 00 00 |C.......|........|
|000000f0| 5b 70 2d 73 5d 00 00 00 | e8 4e 00 00 47 fd ff ff |[p-s]...|.N..G...|
|00000100| cb e6 f5 04 9c 00 00 00 | 13 01 00 00 00 00 00 00 |........|........|
|00000110| 5b 74 2d 7a 5d 00 00 00 | 44 41 54 41 71 05 00 00 |[t-z]...|DATAq...|
|00000120| 48 65 6c 70 20 6f 6e 20 | 43 2b 2b 0a 23 50 61 72 |Help on |C++.#Par|
|00000130| 65 6e 74 20 53 74 72 6f | 6e 67 48 65 6c 70 3a 21 |ent Stro|ngHelp:!|
|00000140| 4d 65 6e 75 0a 43 2b 2b | 20 69 73 20 61 20 73 75 |Menu.C++| is a su|
|00000150| 70 65 72 73 65 74 20 6f | 66 20 43 2c 20 77 68 69 |perset o|f C, whi|
|00000160| 63 68 20 69 6e 63 6f 72 | 70 6f 72 61 74 65 73 20 |ch incor|porates |
|00000170| 63 6c 61 73 73 65 73 20 | 74 6f 20 61 6c 6c 6f 77 |classes |to allow|
|00000180| 20 6f 62 6a 65 63 74 20 | 6f 72 69 65 6e 74 65 64 | object |oriented|
|00000190| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 2e 0a 0a 23 | program|ming...#|
|000001a0| 49 6e 64 65 6e 74 20 36 | 0a 3c 47 43 43 20 32 2e |Indent 6|.<GCC 2.|
|000001b0| 34 2e 35 3e 0a 3c 41 63 | 6f 72 6e 43 5f 43 2b 2b |4.5>.<Ac|ornC_C++|
|000001c0| 3e 0a 0a 3c 4b 65 79 77 | 6f 72 64 73 3d 3e 2e 4b |>..<Keyw|ords=>.K|
|000001d0| 65 79 77 6f 72 64 73 3e | 0a 3c 53 74 61 6e 64 61 |eywords>|.<Standa|
|000001e0| 72 64 20 43 2b 2b 20 4c | 69 62 72 61 72 79 3d 3e |rd C++ L|ibrary=>|
|000001f0| 53 74 61 6e 64 61 72 64 | 43 2b 2b 4c 69 62 3e 0a |Standard|C++Lib>.|
|00000200| 3c 53 74 61 6e 64 61 72 | 64 20 54 65 6d 70 6c 61 |<Standar|d Templa|
|00000210| 74 65 20 4c 69 62 72 61 | 72 79 3d 3e 53 54 4c 3e |te Libra|ry=>STL>|
|00000220| 0a 3c 4a 42 4c 69 62 20 | 43 2b 2b 20 4c 69 62 72 |.<JBLib |C++ Libr|
|00000230| 61 72 79 3d 3e 4a 42 4c | 69 62 3a 21 52 6f 6f 74 |ary=>JBL|ib:!Root|
|00000240| 3e 0a 3c 48 69 6e 74 73 | 20 61 6e 64 20 54 69 70 |>.<Hints| and Tip|
|00000250| 73 3d 3e 48 69 6e 74 73 | 54 69 70 73 3e 0a 23 49 |s=>Hints|Tips>.#I|
|00000260| 6e 64 65 6e 74 3b 0a 23 | 4c 69 6e 65 0a a9 20 4a |ndent;.#|Line.. J|
|00000270| 20 42 20 42 6c 61 75 6b | 6f 70 66 2c 20 54 72 69 | B Blauk|opf, Tri|
|00000280| 6e 69 74 79 20 43 6f 6c | 6c 65 67 65 2c 20 43 61 |nity Col|lege, Ca|
|00000290| 6d 62 72 69 64 67 65 0a | 39 33 62 62 40 65 6e 67 |mbridge.|93bb@eng|
|000002a0| 2e 63 61 6d 2e 61 63 2e | 75 6b 0a 23 53 75 62 70 |.cam.ac.|uk.#Subp|
|000002b0| 61 67 65 20 4b 65 79 77 | 6f 72 64 73 0a 43 2b 2b |age Keyw|ords.C++|
|000002c0| 20 4b 65 79 77 6f 72 64 | 73 0a 53 6f 6d 65 20 6f | Keyword|s.Some o|
|000002d0| 66 20 74 68 65 73 65 20 | 77 6f 72 64 73 20 61 72 |f these |words ar|
|000002e0| 65 20 6c 69 6e 6b 65 64 | 20 74 6f 20 74 68 65 20 |e linked| to the |
|000002f0| 43 20 68 65 6c 70 20 70 | 61 67 65 73 2c 0a 74 6f |C help p|ages,.to|
|00000300| 20 61 76 6f 69 64 20 64 | 75 70 6c 69 63 61 74 69 | avoid d|uplicati|
|00000310| 6e 67 20 65 66 66 6f 72 | 74 2e 0a 0a 23 54 61 62 |ng effor|t...#Tab|
|00000320| 6c 65 20 4c 69 6e 65 73 | 20 38 0a 3c 61 73 6d 3e |le Lines| 8.<asm>|
|00000330| 0a 3c 61 75 74 6f 3d 3e | 72 65 6c 69 63 3e 0a 3c |.<auto=>|relic>.<|
|00000340| 62 72 65 61 6b 3d 3e 43 | 3a 62 72 65 61 6b 3e 0a |break=>C|:break>.|
|00000350| 3c 63 61 73 65 3d 3e 43 | 3a 63 61 73 65 3e 0a 3c |<case=>C|:case>.<|
|00000360| 63 61 74 63 68 3d 3e 2e | 45 78 63 65 70 74 69 6f |catch=>.|Exceptio|
|00000370| 6e 73 3e 0a 3c 63 68 61 | 72 3d 3e 54 79 70 65 73 |ns>.<cha|r=>Types|
|00000380| 3e 0a 63 6c 61 73 73 0a | 3c 63 6f 6e 73 74 3e 0a |>.class.|<const>.|
|00000390| 3c 63 6f 6e 74 69 6e 75 | 65 3e 0a 3c 64 65 66 61 |<continu|e>.<defa|
|000003a0| 75 6c 74 3d 3e 43 3a 64 | 65 66 61 75 6c 74 3e 0a |ult=>C:d|efault>.|
|000003b0| 64 65 6c 65 74 65 0a 3c | 64 6f 3d 3e 43 3a 64 6f |delete.<|do=>C:do|
|000003c0| 3e 0a 3c 64 6f 75 62 6c | 65 3d 3e 54 79 70 65 73 |>.<doubl|e=>Types|
|000003d0| 3e 0a 3c 65 6c 73 65 3d | 3e 43 3a 65 6c 73 65 3e |>.<else=|>C:else>|
|000003e0| 0a 3c 65 6e 75 6d 3e 0a | 65 78 74 65 72 6e 0a 3c |.<enum>.|extern.<|
|000003f0| 66 6c 6f 61 74 3d 3e 54 | 79 70 65 73 3e 0a 3c 66 |float=>T|ypes>.<f|
|00000400| 6f 72 3d 3e 43 3a 66 6f | 72 3e 0a 66 72 69 65 6e |or=>C:fo|r>.frien|
|00000410| 64 0a 3c 67 6f 74 6f 3e | 0a 3c 69 66 3d 3e 43 3a |d.<goto>|.<if=>C:|
|00000420| 69 66 3e 0a 3c 69 6e 6c | 69 6e 65 3e 0a 3c 69 6e |if>.<inl|ine>.<in|
|00000430| 74 3d 3e 54 79 70 65 73 | 3e 0a 3c 6c 6f 6e 67 3d |t=>Types|>.<long=|
|00000440| 3e 54 79 70 65 73 3e 0a | 6e 65 77 0a 6f 70 65 72 |>Types>.|new.oper|
|00000450| 61 74 6f 72 0a 3c 70 72 | 69 76 61 74 65 3d 3e 41 |ator.<pr|ivate=>A|
|00000460| 63 63 65 73 73 53 70 65 | 63 69 66 69 65 72 73 3e |ccessSpe|cifiers>|
|00000470| 0a 3c 70 72 6f 74 65 63 | 74 65 64 3d 3e 41 63 63 |.<protec|ted=>Acc|
|00000480| 65 73 73 53 70 65 63 69 | 66 69 65 72 73 3e 0a 3c |essSpeci|fiers>.<|
|00000490| 70 75 62 6c 69 63 3d 3e | 41 63 63 65 73 73 53 70 |public=>|AccessSp|
|000004a0| 65 63 69 66 69 65 72 73 | 3e 0a 3c 72 65 67 69 73 |ecifiers|>.<regis|
|000004b0| 74 65 72 3d 3e 72 65 6c | 69 63 3e 0a 3c 72 65 74 |ter=>rel|ic>.<ret|
|000004c0| 75 72 6e 3d 3e 43 3a 72 | 65 74 75 72 6e 3e 0a 3c |urn=>C:r|eturn>.<|
|000004d0| 73 68 6f 72 74 3d 3e 54 | 79 70 65 73 3e 0a 3c 73 |short=>T|ypes>.<s|
|000004e0| 69 67 6e 65 64 3d 3e 54 | 79 70 65 73 3e 0a 3c 73 |igned=>T|ypes>.<s|
|000004f0| 69 7a 65 6f 66 3d 3e 43 | 3a 73 69 7a 65 6f 66 3e |izeof=>C|:sizeof>|
|00000500| 0a 73 74 61 74 69 63 0a | 3c 73 74 72 75 63 74 3d |.static.|<struct=|
|00000510| 3e 43 3a 73 74 72 75 63 | 74 3e 0a 3c 73 77 69 74 |>C:struc|t>.<swit|
|00000520| 63 68 3d 3e 43 3a 73 77 | 69 74 63 68 3e 0a 74 65 |ch=>C:sw|itch>.te|
|00000530| 6d 70 6c 61 74 65 0a 74 | 68 69 73 0a 3c 74 68 72 |mplate.t|his.<thr|
|00000540| 6f 77 3d 3e 2e 45 78 63 | 65 70 74 69 6f 6e 73 3e |ow=>.Exc|eptions>|
|00000550| 0a 3c 74 72 79 3d 3e 2e | 45 78 63 65 70 74 69 6f |.<try=>.|Exceptio|
|00000560| 6e 73 3e 0a 3c 74 79 70 | 65 64 65 66 3d 3e 43 3a |ns>.<typ|edef=>C:|
|00000570| 74 79 70 65 64 65 66 3e | 0a 3c 75 6e 69 6f 6e 3d |typedef>|.<union=|
|00000580| 3e 43 3a 75 6e 69 6f 6e | 3e 0a 3c 75 6e 73 69 67 |>C:union|>.<unsig|
|00000590| 6e 65 64 3d 3e 54 79 70 | 65 73 3e 0a 76 69 72 74 |ned=>Typ|es>.virt|
|000005a0| 75 61 6c 0a 3c 76 6f 69 | 64 3d 3e 54 79 70 65 73 |ual.<voi|d=>Types|
|000005b0| 3e 0a 3c 76 6f 6c 61 74 | 69 6c 65 3e 0a 3c 77 68 |>.<volat|ile>.<wh|
|000005c0| 69 6c 65 3d 3e 43 3a 77 | 68 69 6c 65 3e 0a 23 45 |ile=>C:w|hile>.#E|
|000005d0| 6e 64 74 61 62 6c 65 0a | 0a 46 65 61 74 75 72 65 |ndtable.|.Feature|
|000005e0| 73 0a 23 54 61 62 6c 65 | 20 6c 69 6e 65 73 20 35 |s.#Table| lines 5|
|000005f0| 0a 3c 6c 61 62 65 6c 3e | 0a 3c 53 69 7a 65 20 6f |.<label>|.<Size o|
|00000600| 66 20 74 79 70 65 73 3d | 3e 73 69 7a 65 6f 66 76 |f types=|>sizeofv|
|00000610| 61 72 3e 0a 23 45 6e 64 | 74 61 62 6c 65 0a 23 53 |ar>.#End|table.#S|
|00000620| 75 62 70 61 67 65 20 45 | 78 63 65 70 74 69 6f 6e |ubpage E|xception|
|00000630| 73 0a 48 65 6c 70 20 6f | 6e 20 43 2b 2b 20 45 78 |s.Help o|n C++ Ex|
|00000640| 63 65 70 74 69 6f 6e 73 | 0a 45 78 63 65 70 74 69 |ceptions|.Excepti|
|00000650| 6f 6e 73 20 68 61 76 65 | 20 6e 6f 74 20 79 65 74 |ons have| not yet|
|00000660| 20 62 65 65 6e 20 69 6d | 70 6c 65 6d 65 6e 74 65 | been im|plemente|
|00000670| 64 20 6f 6e 20 61 20 52 | 49 53 43 2d 4f 53 20 63 |d on a R|ISC-OS c|
|00000680| 6f 6d 70 69 6c 65 72 2e | 0a 00 00 00 44 49 52 24 |ompiler.|....DIR$|
|00000690| 24 01 00 00 24 01 00 00 | b0 07 00 00 46 ff ff ff |$...$...|....F...|
|000006a0| 20 05 61 ab 9b 07 00 00 | 13 00 00 00 00 00 00 00 | .a.....|........|
|000006b0| 41 63 63 65 73 73 53 70 | 65 63 69 66 69 65 72 73 |AccessSp|ecifiers|
|000006c0| 00 00 00 00 4c 0f 00 00 | 46 ff ff ff 79 6d 6c ab |....L...|F...yml.|
|000006d0| 1c 00 00 00 13 00 00 00 | 00 00 00 00 41 63 6f 72 |........|....Acor|
|000006e0| 6e 43 5f 43 2b 2b 00 00 | 68 0f 00 00 46 ff ff ff |nC_C++..|h...F...|
|000006f0| 3b ce 79 b3 8e 00 00 00 | 13 00 00 00 00 00 00 00 |;.y.....|........|
|00000700| 41 6c 67 54 6f 6f 6c 73 | 00 00 00 00 f8 0f 00 00 |AlgTools|........|
|00000710| 46 ff ff ff 97 97 78 b3 | 39 00 00 00 13 00 00 00 |F.....x.|9.......|
|00000720| 00 00 00 00 42 61 67 73 | 00 00 00 00 34 10 00 00 |....Bags|....4...|
|00000730| 46 ff ff ff 2d 9d 78 b3 | 34 00 00 00 13 00 00 00 |F...-.x.|4.......|
|00000740| 00 00 00 00 43 6f 6c 6c | 65 63 74 69 6f 6e 73 00 |....Coll|ections.|
|00000750| 68 10 00 00 46 ff ff ff | f4 b6 5e ab c8 03 00 00 |h...F...|..^.....|
|00000760| 13 00 00 00 00 00 00 00 | 63 6f 6e 73 74 00 00 00 |........|const...|
|00000770| 30 14 00 00 46 ff ff ff | 12 1a f3 d2 02 01 00 00 |0...F...|........|
|00000780| 13 00 00 00 00 00 00 00 | 61 73 6d 00 34 15 00 00 |........|asm.4...|
|00000790| 46 ff ff ff 37 e7 f3 d2 | 6d 01 00 00 13 00 00 00 |F...7...|m.......|
|000007a0| 00 00 00 00 63 6f 6e 74 | 69 6e 75 65 00 00 00 00 |....cont|inue....|
|000007b0| 44 41 54 41 9b 07 00 00 | 41 63 63 65 73 73 53 70 |DATA....|AccessSp|
|000007c0| 65 63 69 66 69 65 72 73 | 0a 23 50 61 72 65 6e 74 |ecifiers|.#Parent|
|000007d0| 20 43 2b 2b 3a 4b 65 79 | 77 6f 72 64 73 0a 54 68 | C++:Key|words.Th|
|000007e0| 65 72 65 20 61 72 65 20 | 74 68 72 65 65 20 74 79 |ere are |three ty|
|000007f0| 70 65 73 20 6f 66 20 61 | 63 63 65 73 73 20 77 68 |pes of a|ccess wh|
|00000800| 69 63 68 20 63 61 6e 20 | 62 65 20 73 65 74 20 66 |ich can |be set f|
|00000810| 6f 72 0a 62 6f 74 68 20 | 66 75 6e 63 74 69 6f 6e |or.both |function|
|00000820| 73 20 61 6e 64 20 61 74 | 74 72 69 62 75 74 65 73 |s and at|tributes|
|00000830| 20 28 64 61 74 61 20 6d | 65 6d 62 65 72 73 29 20 | (data m|embers) |
|00000840| 6f 66 20 61 20 63 6c 61 | 73 73 2e 0a 0a 4d 6f 72 |of a cla|ss...Mor|
|00000850| 65 20 61 64 76 61 6e 63 | 65 64 20 61 63 63 65 73 |e advanc|ed acces|
|00000860| 73 20 63 6f 6e 74 72 6f | 6c 20 69 73 20 70 6f 73 |s contro|l is pos|
|00000870| 73 69 62 6c 65 20 75 73 | 69 6e 67 0a 3c 50 72 69 |sible us|ing.<Pri|
|00000880| 76 61 74 65 2c 20 50 72 | 6f 74 65 63 74 65 64 2c |vate, Pr|otected,|
|00000890| 20 61 6e 64 20 50 75 62 | 6c 69 63 20 49 6e 68 65 | and Pub|lic Inhe|
|000008a0| 72 69 74 61 6e 63 65 3d | 3e 50 72 69 76 61 74 65 |ritance=|>Private|
|000008b0| 49 6e 68 65 72 69 74 61 | 6e 63 65 3e 20 61 6e 64 |Inherita|nce> and|
|000008c0| 20 74 68 65 0a 3c 46 72 | 69 65 6e 64 3e 20 6b 65 | the.<Fr|iend> ke|
|000008d0| 79 77 6f 72 64 2e 0a 0a | 23 66 48 34 3a 50 75 62 |yword...|#fH4:Pub|
|000008e0| 6c 69 63 0a 54 68 69 73 | 20 69 73 20 74 68 65 20 |lic.This| is the |
|000008f0| 65 61 73 69 65 73 74 20 | 6f 6e 65 20 74 6f 20 75 |easiest |one to u|
|00000900| 73 65 2c 20 62 75 74 20 | 73 68 6f 75 6c 64 20 62 |se, but |should b|
|00000910| 65 20 75 73 65 64 20 61 | 73 0a 6c 69 74 74 6c 65 |e used a|s.little|
|00000920| 20 61 73 20 70 6f 73 73 | 69 62 6c 65 2e 20 49 74 | as poss|ible. It|
|00000930| 20 61 6c 6c 6f 77 73 20 | 61 63 63 65 73 73 20 74 | allows |access t|
|00000940| 6f 20 61 6c 6c 20 61 6e | 64 20 73 75 6e 64 72 79 |o all an|d sundry|
|00000950| 2e 0a 0a 23 66 48 34 3a | 50 72 6f 74 65 63 74 65 |...#fH4:|Protecte|
|00000960| 64 0a 54 68 69 73 20 69 | 73 20 74 68 65 20 6d 6f |d.This i|s the mo|
|00000970| 73 74 20 63 6f 6d 6d 6f | 6e 20 61 63 63 65 73 73 |st commo|n access|
|00000980| 20 73 70 65 63 69 66 69 | 65 64 20 66 6f 72 20 63 | specifi|ed for c|
|00000990| 6c 61 73 73 0a 61 74 74 | 72 69 62 75 74 65 73 2e |lass.att|ributes.|
|000009a0| 20 49 74 20 61 6c 6c 6f | 77 73 20 61 63 63 65 73 | It allo|ws acces|
|000009b0| 20 74 6f 20 61 6c 6c 20 | 64 65 72 69 76 65 64 20 | to all |derived |
|000009c0| 63 6c 61 73 73 65 73 2e | 0a 0a 23 66 48 34 3a 50 |classes.|..#fH4:P|
|000009d0| 72 69 76 61 74 65 0a 54 | 68 69 73 20 69 73 20 74 |rivate.T|his is t|
|000009e0| 68 65 20 6d 6f 73 74 20 | 72 65 73 74 72 69 63 74 |he most |restrict|
|000009f0| 69 76 65 2c 20 61 6c 6c | 6f 77 69 6e 67 20 6f 6e |ive, all|owing on|
|00000a00| 6c 79 20 74 68 65 20 63 | 6c 61 73 73 0a 69 74 73 |ly the c|lass.its|
|00000a10| 65 6c 66 20 74 6f 20 61 | 63 63 65 73 73 20 74 68 |elf to a|ccess th|
|00000a20| 65 20 64 61 74 61 20 6f | 72 20 66 75 6e 63 74 69 |e data o|r functi|
|00000a30| 6f 6e 2e 0a 0a 3c 45 78 | 61 6d 70 6c 65 3d 3e 2e |on...<Ex|ample=>.|
|00000a40| 45 78 61 6d 70 6c 65 3e | 0a 23 53 75 62 70 61 67 |Example>|.#Subpag|
|00000a50| 65 20 45 78 61 6d 70 6c | 65 0a 45 78 61 6d 70 6c |e Exampl|e.Exampl|
|00000a60| 65 20 75 73 61 67 65 20 | 6f 66 20 61 63 63 65 73 |e usage |of acces|
|00000a70| 73 20 73 70 65 63 69 66 | 69 65 72 73 0a 23 66 43 |s specif|iers.#fC|
|00000a80| 6f 64 65 0a 63 6c 61 73 | 73 20 42 61 73 65 0a 7b |ode.clas|s Base.{|
|00000a90| 0a 70 72 69 76 61 74 65 | 3a 0a 20 20 20 20 20 69 |.private|:. i|
|00000aa0| 6e 74 20 20 20 20 50 72 | 69 76 61 74 65 44 61 74 |nt Pr|ivateDat|
|00000ab0| 61 3b 0a 20 20 20 20 20 | 69 6e 74 20 20 20 20 50 |a;. |int P|
|00000ac0| 72 69 76 61 74 65 46 75 | 6e 63 74 69 6f 6e 28 76 |rivateFu|nction(v|
|00000ad0| 6f 69 64 29 20 7b 20 72 | 65 74 75 72 6e 20 50 72 |oid) { r|eturn Pr|
|00000ae0| 69 76 61 74 65 44 61 74 | 61 3b 20 7d 0a 70 72 6f |ivateDat|a; }.pro|
|00000af0| 74 65 63 74 65 64 3a 0a | 20 20 20 20 20 69 6e 74 |tected:.| int|
|00000b00| 20 20 20 20 50 72 6f 74 | 65 63 74 65 64 44 61 74 | Prot|ectedDat|
|00000b10| 61 3b 0a 20 20 20 20 20 | 69 6e 74 20 20 20 20 50 |a;. |int P|
|00000b20| 72 6f 74 65 63 74 65 64 | 46 75 6e 63 74 69 6f 6e |rotected|Function|
|00000b30| 28 76 6f 69 64 29 20 7b | 20 72 65 74 75 72 6e 20 |(void) {| return |
|00000b40| 50 72 6f 74 65 63 74 65 | 64 44 61 74 61 3b 20 7d |Protecte|dData; }|
|00000b50| 0a 70 75 62 6c 69 63 3a | 0a 20 20 20 20 20 69 6e |.public:|. in|
|00000b60| 74 20 20 20 20 50 75 62 | 6c 69 63 44 61 74 61 3b |t Pub|licData;|
|00000b70| 0a 20 20 20 20 20 69 6e | 74 20 20 20 20 50 75 62 |. in|t Pub|
|00000b80| 6c 69 63 46 75 6e 63 74 | 69 6f 6e 28 76 6f 69 64 |licFunct|ion(void|
|00000b90| 29 20 7b 20 72 65 74 75 | 72 6e 20 50 75 62 6c 69 |) { retu|rn Publi|
|00000ba0| 63 44 61 74 61 3b 20 7d | 0a 0a 20 20 20 20 20 76 |cData; }|.. v|
|00000bb0| 6f 69 64 20 20 20 46 75 | 6e 63 74 69 6f 6e 41 28 |oid Fu|nctionA(|
|00000bc0| 76 6f 69 64 29 3b 0a 7d | 3b 0a 0a 63 6c 61 73 73 |void);.}|;..class|
|00000bd0| 20 44 65 72 69 76 65 64 | 20 3a 20 70 75 62 6c 69 | Derived| : publi|
|00000be0| 63 20 42 61 73 65 0a 7b | 0a 20 20 20 20 76 6f 69 |c Base.{|. voi|
|00000bf0| 64 20 46 75 6e 63 74 69 | 6f 6e 42 28 76 6f 69 64 |d Functi|onB(void|
|00000c00| 29 3b 0a 7d 3b 0a 0a 76 | 6f 69 64 20 42 61 73 65 |);.};..v|oid Base|
|00000c10| 3a 3a 46 75 6e 63 74 69 | 6f 6e 41 28 76 6f 69 64 |::Functi|onA(void|
|00000c20| 29 0a 7b 0a 20 20 20 50 | 72 69 76 61 74 65 44 61 |).{. P|rivateDa|
|00000c30| 74 61 20 3d 20 50 72 69 | 76 61 74 65 46 75 6e 63 |ta = Pri|vateFunc|
|00000c40| 74 69 6f 6e 28 29 3b 20 | 20 20 20 20 20 20 2f 2f |tion(); | //|
|00000c50| 61 6c 6c 20 6f 6b 0a 20 | 20 20 50 72 6f 74 65 63 |all ok. | Protec|
|00000c60| 74 65 64 44 61 74 61 20 | 3d 20 50 72 6f 74 65 63 |tedData |= Protec|
|00000c70| 74 65 64 46 75 6e 63 74 | 69 6f 6e 28 29 3b 20 20 |tedFunct|ion(); |
|00000c80| 20 2f 2f 64 69 74 74 6f | 0a 20 20 20 50 75 62 6c | //ditto|. Publ|
|00000c90| 69 63 44 61 74 61 20 3d | 20 50 75 62 6c 69 63 46 |icData =| PublicF|
|00000ca0| 75 6e 63 74 69 6f 6e 28 | 29 3b 20 20 20 20 20 20 |unction(|); |
|00000cb0| 20 20 20 2f 2f 61 6e 64 | 20 61 67 61 69 6e 0a 7d | //and| again.}|
|00000cc0| 0a 0a 76 6f 69 64 20 44 | 65 72 69 76 65 64 3a 3a |..void D|erived::|
|00000cd0| 46 75 6e 63 74 69 6f 6e | 42 28 76 6f 69 64 29 0a |Function|B(void).|
|00000ce0| 7b 0a 20 20 20 50 72 69 | 76 61 74 65 44 61 74 61 |{. Pri|vateData|
|00000cf0| 20 3d 20 31 3b 20 20 20 | 20 20 20 20 20 20 20 20 | = 1; | |
|00000d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 61 | | // a|
|00000d10| 63 63 65 73 73 20 76 69 | 6f 6c 61 74 69 6f 6e 0a |ccess vi|olation.|
|00000d20| 20 20 20 69 6e 74 20 61 | 20 3d 20 50 72 69 76 61 | int a| = Priva|
|00000d30| 74 65 46 75 6e 63 74 69 | 6f 6e 28 29 3b 20 20 20 |teFuncti|on(); |
|00000d40| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 61 63 63 | | // acc|
|00000d50| 65 73 73 20 76 69 6f 6c | 61 74 69 6f 6e 0a 20 20 |ess viol|ation. |
|00000d60| 20 50 72 6f 74 65 63 74 | 65 64 44 61 74 61 20 3d | Protect|edData =|
|00000d70| 20 50 72 6f 74 65 63 74 | 65 64 46 75 6e 63 74 69 | Protect|edFuncti|
|00000d80| 6f 6e 28 29 3b 20 20 20 | 2f 2f 20 74 68 69 73 20 |on(); |// this |
|00000d90| 69 73 20 66 69 6e 65 0a | 20 20 20 50 75 62 6c 69 |is fine.| Publi|
|00000da0| 63 44 61 74 61 20 3d 20 | 50 75 62 6c 69 63 46 75 |cData = |PublicFu|
|00000db0| 6e 63 74 69 6f 6e 28 29 | 3b 20 20 20 20 20 20 20 |nction()|; |
|00000dc0| 20 20 2f 2f 20 61 6e 64 | 20 74 68 69 73 0a 7d 0a | // and| this.}.|
|00000dd0| 0a 69 6e 74 20 6d 61 69 | 6e 28 76 6f 69 64 29 0a |.int mai|n(void).|
|00000de0| 7b 0a 20 20 20 42 61 73 | 65 20 61 6c 70 68 61 3b |{. Bas|e alpha;|
|00000df0| 0a 20 20 20 61 6c 70 68 | 61 2e 50 72 69 76 61 74 |. alph|a.Privat|
|00000e00| 65 44 61 74 61 20 3d 20 | 30 3b 20 20 20 20 20 20 |eData = |0; |
|00000e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 61 | | // a|
|00000e20| 63 63 65 73 73 20 76 69 | 6f 6c 61 74 69 6f 6e 0a |ccess vi|olation.|
|00000e30| 20 20 20 69 6e 74 20 61 | 20 3d 20 61 6c 70 68 61 | int a| = alpha|
|00000e40| 2e 50 72 69 76 61 74 65 | 46 75 6e 63 74 69 6f 6e |.Private|Function|
|00000e50| 28 29 3b 20 20 20 20 20 | 20 20 20 2f 2f 20 61 6e |(); | // an|
|00000e60| 64 20 61 67 61 69 6e 0a | 20 20 20 61 6c 70 68 61 |d again.| alpha|
|00000e70| 2e 50 72 6f 74 65 63 74 | 65 64 44 61 74 61 20 3d |.Protect|edData =|
|00000e80| 20 30 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | 0; | |
|00000e90| 20 20 20 2f 2f 20 79 65 | 74 20 61 6e 6f 74 68 65 | // ye|t anothe|
|00000ea0| 72 0a 20 20 20 61 20 3d | 20 61 6c 70 68 61 2e 50 |r. a =| alpha.P|
|00000eb0| 72 6f 74 65 63 74 65 64 | 46 75 6e 63 74 69 6f 6e |rotected|Function|
|00000ec0| 28 29 3b 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 |(); | // |
|00000ed0| 61 6e 6f 74 68 65 72 20 | 65 72 72 6f 72 0a 20 20 |another |error. |
|00000ee0| 20 61 2e 50 75 62 6c 69 | 63 44 61 74 61 20 3d 20 | a.Publi|cData = |
|00000ef0| 61 2e 50 75 62 6c 69 63 | 46 75 6e 63 74 69 6f 6e |a.Public|Function|
|00000f00| 28 29 3b 20 20 20 20 20 | 20 2f 2f 20 62 75 74 20 |(); | // but |
|00000f10| 74 68 69 73 20 69 73 20 | 6f 6b 0a 7d 0a 0a 23 66 |this is |ok.}..#f|
|00000f20| 53 74 64 0a 41 63 63 65 | 73 73 20 76 69 6f 6c 61 |Std.Acce|ss viola|
|00000f30| 74 69 6f 6e 73 20 61 72 | 65 20 63 6f 6d 70 69 6c |tions ar|e compil|
|00000f40| 65 72 20 65 72 72 6f 72 | 73 2e 0a 00 44 41 54 41 |er error|s...DATA|
|00000f50| 1c 00 00 00 48 65 6c 70 | 20 6f 6e 20 41 63 6f 72 |....Help| on Acor|
|00000f60| 6e 20 43 2f 43 2b 2b 0a | 44 41 54 41 8e 00 00 00 |n C/C++.|DATA....|
|00000f70| 41 6c 67 6f 72 69 74 68 | 6d 69 63 20 54 6f 6f 6c |Algorith|mic Tool|
|00000f80| 73 0a 23 54 61 62 6c 65 | 20 6c 69 6e 65 73 20 35 |s.#Table| lines 5|
|00000f90| 0a 3c 44 61 74 65 2f 54 | 69 6d 65 3e 0a 3c 46 69 |.<Date/T|ime>.<Fi|
|00000fa0| 6c 74 65 72 73 3e 0a 3c | 50 61 74 74 65 72 6e 20 |lters>.<|Pattern |
|00000fb0| 4d 61 74 63 68 69 6e 67 | 3d 3e 50 61 74 74 65 72 |Matching|=>Patter|
|00000fc0| 6e 4d 61 74 63 68 69 6e | 67 3e 0a 3c 53 65 61 72 |nMatchin|g>.<Sear|
|00000fd0| 63 68 69 6e 67 3e 0a 3c | 53 6f 72 74 69 6e 67 3e |ching>.<|Sorting>|
|00000fe0| 0a 3c 55 74 69 6c 69 74 | 69 65 73 3e 0a 23 45 6e |.<Utilit|ies>.#En|
|00000ff0| 64 74 61 62 6c 65 00 00 | 44 41 54 41 39 00 00 00 |dtable..|DATA9...|
|00001000| 42 61 67 73 0a 43 6f 6c | 6c 65 63 74 69 6f 6e 20 |Bags.Col|lection |
|00001010| 6f 66 20 28 70 6f 73 73 | 69 62 6c 79 20 64 75 70 |of (poss|ibly dup|
|00001020| 6c 69 63 61 74 65 29 20 | 69 74 65 6d 73 0a 0a 0a |licate) |items...|
|00001030| 0a 00 00 00 44 41 54 41 | 34 00 00 00 43 6f 6c 6c |....DATA|4...Coll|
|00001040| 65 63 74 69 6f 6e 73 0a | 49 6e 64 65 78 61 62 6c |ections.|Indexabl|
|00001050| 65 20 63 6f 6c 6c 65 63 | 74 69 6f 6e 20 6f 66 20 |e collec|tion of |
|00001060| 69 74 65 6d 73 0a 0a 0a | 44 41 54 41 c8 03 00 00 |items...|DATA....|
|00001070| 48 65 6c 70 20 6f 6e 20 | 43 2b 2b 20 6b 65 79 77 |Help on |C++ keyw|
|00001080| 6f 72 64 20 63 6f 6e 73 | 74 0a 23 50 61 72 65 6e |ord cons|t.#Paren|
|00001090| 74 20 43 2b 2b 3a 48 69 | 6e 74 73 54 69 70 73 0a |t C++:Hi|ntsTips.|
|000010a0| 23 66 48 34 3a 43 6f 6e | 73 74 20 4d 65 6d 62 65 |#fH4:Con|st Membe|
|000010b0| 72 20 46 75 6e 63 74 69 | 6f 6e 73 0a 49 66 20 61 |r Functi|ons.If a|
|000010c0| 20 6d 65 6d 62 65 72 20 | 66 75 6e 63 74 69 6f 6e | member |function|
|000010d0| 20 6f 66 20 61 20 63 6c | 61 73 73 20 69 73 20 64 | of a cl|ass is d|
|000010e0| 65 63 6c 61 72 65 64 20 | 63 6f 6e 73 74 2c 20 74 |eclared |const, t|
|000010f0| 68 65 6e 20 69 74 0a 69 | 73 20 64 65 63 6c 61 72 |hen it.i|s declar|
|00001100| 69 6e 67 20 74 68 61 74 | 20 69 74 20 77 69 6c 6c |ing that| it will|
|00001110| 20 6e 6f 74 20 6d 6f 64 | 69 66 79 20 61 6e 79 20 | not mod|ify any |
|00001120| 63 6c 61 73 73 20 6d 65 | 6d 62 65 72 20 64 61 74 |class me|mber dat|
|00001130| 61 2e 0a 0a 45 78 61 6d | 70 6c 65 3a 0a 23 66 43 |a...Exam|ple:.#fC|
|00001140| 6f 64 65 0a 63 6c 61 73 | 73 20 41 0a 7b 0a 09 69 |ode.clas|s A.{..i|
|00001150| 6e 74 09 09 6d 65 6d 62 | 65 72 5f 64 61 74 61 3b |nt..memb|er_data;|
|00001160| 0a 09 76 6f 69 64 20 66 | 75 6e 63 74 69 6f 6e 28 |..void f|unction(|
|00001170| 76 6f 69 64 29 20 63 6f | 6e 73 74 3b 0a 7d 3b 0a |void) co|nst;.};.|
|00001180| 0a 76 6f 69 64 20 41 3a | 3a 66 75 6e 63 74 69 6f |.void A:|:functio|
|00001190| 6e 28 76 6f 69 64 29 20 | 63 6f 6e 73 74 0a 7b 0a |n(void) |const.{.|
|000011a0| 09 6d 65 6d 62 65 72 5f | 64 61 74 61 20 3d 20 35 |.member_|data = 5|
|000011b0| 3b 20 2f 2f 76 69 6f 6c | 61 74 65 73 20 63 6f 6e |; //viol|ates con|
|000011c0| 73 74 0a 7d 0a 23 66 53 | 74 64 0a 54 68 69 73 20 |st.}.#fS|td.This |
|000011d0| 63 6f 64 65 20 77 69 6c | 6c 20 62 65 20 72 65 6a |code wil|l be rej|
|000011e0| 65 63 74 65 64 20 62 79 | 20 74 68 65 20 63 6f 6d |ected by| the com|
|000011f0| 70 69 6c 65 72 2e 20 49 | 6e 20 65 73 73 65 6e 63 |piler. I|n essenc|
|00001200| 65 2c 0a 74 68 65 20 61 | 64 64 69 74 69 6f 6e 20 |e,.the a|ddition |
|00001210| 6f 66 20 63 6f 6e 73 74 | 20 74 6f 20 61 20 66 75 |of const| to a fu|
|00001220| 6e 63 74 69 6f 6e 20 6d | 65 61 6e 73 20 74 68 61 |nction m|eans tha|
|00001230| 74 2c 20 77 69 74 68 69 | 6e 20 74 68 61 74 0a 66 |t, withi|n that.f|
|00001240| 75 6e 63 74 69 6f 6e 2c | 20 74 68 65 20 6f 62 6a |unction,| the obj|
|00001250| 65 63 74 20 69 73 20 63 | 6f 6e 73 74 61 6e 74 2e |ect is c|onstant.|
|00001260| 20 0a 0a 0a 23 66 48 34 | 3a 43 6f 6e 73 74 20 50 | ...#fH4|:Const P|
|00001270| 6f 69 6e 74 65 72 73 0a | 54 68 65 72 65 20 61 72 |ointers.|There ar|
|00001280| 65 20 74 77 6f 20 70 6f | 73 73 69 62 6c 65 20 70 |e two po|ssible p|
|00001290| 6f 73 69 74 69 6f 6e 73 | 20 6f 66 20 63 6f 6e 73 |ositions| of cons|
|000012a0| 74 20 77 69 74 68 69 6e | 20 74 68 65 20 64 65 66 |t within| the def|
|000012b0| 69 6e 69 74 69 6f 6e 0a | 6f 66 20 61 20 70 6f 69 |inition.|of a poi|
|000012c0| 6e 74 65 72 2e 20 46 69 | 72 73 74 6c 79 2c 20 69 |nter. Fi|rstly, i|
|000012d0| 6e 20 74 68 65 20 63 6f | 6d 6d 6f 6e 20 63 61 73 |n the co|mmon cas|
|000012e0| 65 3a 0a 23 66 43 6f 64 | 65 0a 63 6f 6e 73 74 20 |e:.#fCod|e.const |
|000012f0| 69 6e 74 2a 20 70 74 72 | 3b 0a 0a 23 66 53 74 64 |int* ptr|;..#fStd|
|00001300| 0a 54 68 69 73 20 6d 65 | 61 6e 73 20 74 68 61 74 |.This me|ans that|
|00001310| 20 74 68 65 20 69 6e 74 | 20 69 73 20 63 6f 6e 73 | the int| is cons|
|00001320| 74 61 6e 74 2c 20 62 75 | 74 20 74 68 65 20 70 6f |tant, bu|t the po|
|00001330| 69 6e 74 65 72 0a 69 73 | 20 6e 6f 74 2e 20 53 6f |inter.is| not. So|
|00001340| 2c 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 0a 23 |, for ex|ample,.#|
|00001350| 66 43 6f 64 65 0a 70 74 | 72 20 3d 20 6e 65 77 20 |fCode.pt|r = new |
|00001360| 69 6e 74 3b 0a 0a 23 66 | 53 74 64 0a 69 73 20 6c |int;..#f|Std.is l|
|00001370| 65 67 61 6c 2c 20 77 68 | 65 72 65 61 73 0a 23 66 |egal, wh|ereas.#f|
|00001380| 43 6f 64 65 0a 2a 70 74 | 72 20 3d 20 31 3b 0a 23 |Code.*pt|r = 1;.#|
|00001390| 66 53 74 64 0a 0a 77 69 | 6c 6c 20 62 65 20 72 65 |fStd..wi|ll be re|
|000013a0| 6a 65 63 74 65 64 20 62 | 79 20 74 68 65 20 63 6f |jected b|y the co|
|000013b0| 6d 70 69 6c 65 72 2e 0a | 0a 53 69 6d 69 6c 61 72 |mpiler..|.Similar|
|000013c0| 6c 79 2c 0a 23 66 43 6f | 64 65 0a 69 6e 74 2a 20 |ly,.#fCo|de.int* |
|000013d0| 63 6f 6e 73 74 20 70 74 | 72 3b 0a 0a 23 66 53 74 |const pt|r;..#fSt|
|000013e0| 64 0a 61 6c 6c 6f 77 73 | 20 74 68 65 20 63 6f 6e |d.allows| the con|
|000013f0| 74 65 6e 74 73 20 6f 66 | 20 74 68 65 20 70 6f 69 |tents of| the poi|
|00001400| 6e 74 65 72 20 74 6f 20 | 62 65 20 6d 6f 64 69 66 |nter to |be modif|
|00001410| 69 65 64 2c 20 62 75 74 | 0a 6e 6f 74 20 74 68 65 |ied, but|.not the|
|00001420| 20 70 6f 69 6e 74 65 72 | 20 69 74 73 65 6c 66 2e | pointer| itself.|
|00001430| 44 41 54 41 02 01 00 00 | 61 73 6d 0a 54 68 69 73 |DATA....|asm.This|
|00001440| 20 73 74 61 74 65 6d 65 | 6e 74 20 69 73 20 75 73 | stateme|nt is us|
|00001450| 65 64 20 74 6f 20 65 6d | 62 65 64 20 61 73 73 65 |ed to em|bed asse|
|00001460| 6d 62 6c 79 20 69 6e 20 | 61 20 43 2b 2b 20 73 6f |mbly in |a C++ so|
|00001470| 75 72 63 65 2e 20 54 68 | 65 72 65 20 69 73 20 6e |urce. Th|ere is n|
|00001480| 6f 20 73 70 65 63 69 66 | 69 63 20 66 6f 72 6d 61 |o specif|ic forma|
|00001490| 74 20 74 68 61 74 20 49 | 20 61 6d 20 61 77 61 72 |t that I| am awar|
|000014a0| 65 20 6f 66 2c 20 73 69 | 6e 63 65 20 6f 62 76 69 |e of, si|nce obvi|
|000014b0| 6f 75 73 6c 79 20 74 68 | 65 20 63 6f 64 65 20 77 |ously th|e code w|
|000014c0| 6f 75 6c 64 20 62 65 20 | 61 62 6f 75 74 20 61 73 |ould be |about as|
|000014d0| 20 6e 6f 6e 2d 70 6f 72 | 74 61 62 6c 65 20 61 73 | non-por|table as|
|000014e0| 20 79 6f 75 20 63 61 6e | 20 67 65 74 2e 20 49 20 | you can| get. I |
|000014f0| 64 6f 6e 27 74 20 6b 6e | 6f 77 20 68 6f 77 20 69 |don't kn|ow how i|
|00001500| 74 20 69 73 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |t is imp|lemented|
|00001510| 20 6f 6e 20 65 69 74 68 | 65 72 20 41 63 6f 72 6e | on eith|er Acorn|
|00001520| 20 43 2b 2b 2c 0a 6f 72 | 20 45 61 73 79 20 43 2b | C++,.or| Easy C+|
|00001530| 2b 2e 00 00 44 41 54 41 | 6d 01 00 00 63 6f 6e 74 |+...DATA|m...cont|
|00001540| 69 6e 75 65 0a 54 68 65 | 20 63 6f 6e 74 69 6e 75 |inue.The| continu|
|00001550| 65 20 73 74 61 74 65 6d | 65 6e 74 20 69 73 20 61 |e statem|ent is a|
|00001560| 20 73 6c 69 67 68 74 6c | 79 20 73 74 72 75 63 74 | slightl|y struct|
|00001570| 75 72 65 64 20 67 6f 74 | 6f 2e 20 49 74 20 63 61 |ured got|o. It ca|
|00001580| 6e 20 6f 6e 6c 79 20 62 | 65 20 75 73 65 64 20 77 |n only b|e used w|
|00001590| 69 74 68 69 6e 20 61 6e | 20 69 74 65 72 61 74 69 |ithin an| iterati|
|000015a0| 76 65 20 62 6c 6f 63 6b | 2c 20 61 6e 64 20 70 61 |ve block|, and pa|
|000015b0| 73 73 65 73 20 63 6f 6e | 74 72 6f 6c 20 74 6f 20 |sses con|trol to |
|000015c0| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 6c |the end |of the l|
|000015d0| 6f 6f 70 2c 20 62 75 74 | 20 64 6f 65 20 6e 6f 74 |oop, but| doe not|
|000015e0| 20 74 65 72 6d 69 6e 61 | 74 65 20 74 68 65 20 6c | termina|te the l|
|000015f0| 6f 6f 70 2e 20 41 20 28 | 63 6f 6e 74 72 69 76 65 |oop. A (|contrive|
|00001600| 64 29 20 65 78 61 6d 70 | 6c 65 20 69 73 20 73 68 |d) examp|le is sh|
|00001610| 6f 77 6e 3a 0a 0a 23 66 | 43 6f 64 65 0a 66 6f 72 |own:..#f|Code.for|
|00001620| 28 69 6e 74 20 69 20 3d | 20 30 3b 3b 20 69 2b 2b |(int i =| 0;; i++|
|00001630| 29 0a 5c 7b 0a 23 69 6e | 64 65 6e 74 20 33 0a 69 |).\{.#in|dent 3.i|
|00001640| 66 28 21 69 73 5f 70 72 | 69 6d 65 28 69 29 29 0a |f(!is_pr|ime(i)).|
|00001650| 23 69 6e 64 65 6e 74 20 | 36 0a 63 6f 6e 74 69 6e |#indent |6.contin|
|00001660| 75 65 3b 0a 23 69 6e 64 | 65 6e 74 20 33 0a 63 6f |ue;.#ind|ent 3.co|
|00001670| 75 74 20 3c 3c 20 69 20 | 3c 3c 20 22 20 69 73 20 |ut << i |<< " is |
|00001680| 70 72 69 6d 65 22 20 3c | 3c 20 65 6e 64 6c 3b 0a |prime" <|< endl;.|
|00001690| 23 69 6e 64 65 6e 74 20 | 30 0a 7d 0a 23 66 53 74 |#indent |0.}.#fSt|
|000016a0| 64 00 00 00 44 49 52 24 | 70 00 00 00 70 00 00 00 |d...DIR$|p...p...|
|000016b0| 14 17 00 00 46 ff ff ff | e6 94 79 b3 1c 02 00 00 |....F...|..y.....|
|000016c0| 13 00 00 00 00 00 00 00 | 44 61 74 61 53 74 72 75 |........|DataStru|
|000016d0| 63 74 73 00 30 19 00 00 | 46 ff ff ff be a5 78 b3 |cts.0...|F.....x.|
|000016e0| 5d 00 00 00 13 00 00 00 | 00 00 00 00 44 65 71 75 |].......|....Dequ|
|000016f0| 65 73 00 00 90 19 00 00 | 46 ff ff ff c9 16 ef d2 |es......|F.......|
|00001700| 0a 02 00 00 13 00 00 00 | 00 00 00 00 65 6e 75 6d |........|....enum|
|00001710| 00 00 00 00 44 41 54 41 | 1c 02 00 00 44 61 74 61 |....DATA|....Data|
|00001720| 20 53 74 72 75 63 74 75 | 72 65 73 0a 44 61 74 61 | Structu|res.Data|
|00001730| 20 73 74 72 75 63 74 75 | 72 65 73 20 63 61 6e 20 | structu|res can |
|00001740| 62 65 20 73 75 62 2d 64 | 69 76 69 64 65 64 20 69 |be sub-d|ivided i|
|00001750| 6e 74 6f 20 74 77 6f 20 | 74 79 70 65 73 3a 0a 3c |nto two |types:.<|
|00001760| 43 6f 6c 6c 65 63 74 69 | 6f 6e 73 3d 3e 2e 43 6f |Collecti|ons=>.Co|
|00001770| 6c 6c 65 63 74 69 6f 6e | 73 3e 0a 3c 53 65 71 75 |llection|s>.<Sequ|
|00001780| 65 6e 63 65 73 3d 3e 2e | 53 65 71 75 65 6e 63 65 |ences=>.|Sequence|
|00001790| 73 3e 0a 3c 41 6c 6c 20 | 74 79 70 65 73 3d 3e 2e |s>.<All |types=>.|
|000017a0| 41 6c 6c 54 79 70 65 73 | 3e 0a 23 53 75 62 70 61 |AllTypes|>.#Subpa|
|000017b0| 67 65 20 41 6c 6c 54 79 | 70 65 73 0a 41 6c 6c 20 |ge AllTy|pes.All |
|000017c0| 64 61 74 61 20 73 74 72 | 75 63 74 75 72 65 20 74 |data str|ucture t|
|000017d0| 79 70 65 73 0a 23 54 61 | 62 6c 65 20 6c 69 6e 65 |ypes.#Ta|ble line|
|000017e0| 73 20 35 0a 3c 42 61 67 | 73 3e 0a 3c 43 6f 6c 6c |s 5.<Bag|s>.<Coll|
|000017f0| 65 63 74 69 6f 6e 73 3e | 0a 3c 44 65 71 75 65 73 |ections>|.<Deques|
|00001800| 3e 0a 3c 47 72 61 70 68 | 73 3e 0a 3c 4c 69 73 74 |>.<Graph|s>.<List|
|00001810| 73 3e 0a 3c 4d 61 70 73 | 3e 0a 3c 51 75 65 75 65 |s>.<Maps|>.<Queue|
|00001820| 73 3e 0a 3c 52 69 6e 67 | 73 3e 0a 3c 53 65 74 73 |s>.<Ring|s>.<Sets|
|00001830| 3e 0a 3c 53 74 61 63 6b | 73 3e 0a 3c 53 74 72 69 |>.<Stack|s>.<Stri|
|00001840| 6e 67 73 3e 0a 3c 54 72 | 65 65 73 3e 0a 23 45 6e |ngs>.<Tr|ees>.#En|
|00001850| 64 74 61 62 6c 65 0a 23 | 53 75 62 70 61 67 65 20 |dtable.#|Subpage |
|00001860| 43 6f 6c 6c 65 63 74 69 | 6f 6e 73 0a 43 6f 6c 6c |Collecti|ons.Coll|
|00001870| 65 63 74 69 6f 6e 73 0a | 23 54 61 62 6c 65 20 6c |ections.|#Table l|
|00001880| 69 6e 65 73 20 35 0a 3c | 42 61 67 73 3e 0a 3c 43 |ines 5.<|Bags>.<C|
|00001890| 6f 6c 6c 65 63 74 69 6f | 6e 73 3e 0a 3c 47 72 61 |ollectio|ns>.<Gra|
|000018a0| 70 68 73 3e 0a 3c 53 65 | 74 73 3e 0a 3c 54 72 65 |phs>.<Se|ts>.<Tre|
|000018b0| 65 73 3e 0a 23 45 6e 64 | 74 61 62 6c 65 0a 23 53 |es>.#End|table.#S|
|000018c0| 75 62 70 61 67 65 20 53 | 65 71 75 65 6e 63 65 73 |ubpage S|equences|
|000018d0| 0a 53 65 71 75 65 6e 63 | 65 73 0a 23 54 61 62 6c |.Sequenc|es.#Tabl|
|000018e0| 65 20 6c 69 6e 65 73 20 | 35 0a 3c 44 65 71 75 65 |e lines |5.<Deque|
|000018f0| 73 3e 0a 3c 4c 69 73 74 | 73 3e 0a 3c 4d 61 70 73 |s>.<List|s>.<Maps|
|00001900| 3e 0a 3c 51 75 65 75 65 | 73 3e 0a 3c 52 69 6e 67 |>.<Queue|s>.<Ring|
|00001910| 73 3e 0a 3c 53 74 61 63 | 6b 73 3e 0a 3c 53 74 72 |s>.<Stac|ks>.<Str|
|00001920| 69 6e 67 73 3e 0a 23 45 | 6e 64 74 61 62 6c 65 0a |ings>.#E|ndtable.|
|00001930| 44 41 54 41 5d 00 00 00 | 44 65 71 75 65 73 0a 53 |DATA]...|Deques.S|
|00001940| 65 71 75 65 6e 63 65 20 | 6f 66 20 69 74 65 6d 73 |equence |of items|
|00001950| 20 69 6e 20 77 68 69 63 | 68 20 69 74 65 6d 73 20 | in whic|h items |
|00001960| 6d 61 79 20 62 65 20 61 | 64 64 65 64 20 61 6e 64 |may be a|dded and|
|00001970| 20 72 65 6d 6f 76 65 64 | 20 66 72 6f 6d 20 65 69 | removed| from ei|
|00001980| 74 68 65 72 20 65 6e 64 | 2e 0a 0a 0a 0a 00 00 00 |ther end|........|
|00001990| 44 41 54 41 0a 02 00 00 | 65 6e 75 6d 0a 23 50 61 |DATA....|enum.#Pa|
|000019a0| 72 65 6e 74 20 43 2b 2b | 3a 6b 65 79 77 6f 72 64 |rent C++|:keyword|
|000019b0| 73 0a 45 6e 75 6d 65 72 | 61 74 65 64 20 74 79 70 |s.Enumer|ated typ|
|000019c0| 65 73 20 61 72 65 20 61 | 6e 20 61 6c 74 65 72 6e |es are a|n altern|
|000019d0| 61 74 69 76 65 20 74 6f | 20 6e 61 6d 69 6e 67 20 |ative to| naming |
|000019e0| 69 6e 74 65 67 65 72 20 | 63 6f 6e 73 74 61 6e 74 |integer |constant|
|000019f0| 73 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0a |s. For e|xample:.|
|00001a00| 0a 23 66 43 6f 64 65 0a | 09 65 6e 75 6d 20 5c 7b |.#fCode.|.enum \{|
|00001a10| 20 57 48 49 54 45 20 3d | 20 30 2c 20 47 52 45 59 | WHITE =| 0, GREY|
|00001a20| 2c 20 42 4c 41 43 4b 20 | 3d 20 37 2c 20 42 4c 55 |, BLACK |= 7, BLU|
|00001a30| 45 20 7d 3b 0a 23 66 53 | 74 64 0a 0a 49 6e 20 74 |E };.#fS|td..In t|
|00001a40| 68 69 73 20 65 78 61 6d | 70 6c 65 2c 20 47 52 45 |his exam|ple, GRE|
|00001a50| 59 20 69 73 20 6e 6f 74 | 20 65 78 70 6c 69 63 69 |Y is not| explici|
|00001a60| 74 6c 79 20 61 73 73 69 | 67 6e 65 64 20 61 20 76 |tly assi|gned a v|
|00001a70| 61 6c 75 65 2c 20 73 6f | 20 69 6d 70 6c 69 63 69 |alue, so| implici|
|00001a80| 74 6c 79 20 69 74 20 62 | 65 63 6f 6d 65 73 20 57 |tly it b|ecomes W|
|00001a90| 48 49 54 45 20 2b 20 31 | 20 3d 20 31 2e 20 53 69 |HITE + 1| = 1. Si|
|00001aa0| 6d 69 6c 61 72 6c 79 20 | 42 4c 55 45 20 69 73 20 |milarly |BLUE is |
|00001ab0| 38 2e 0a 0a 49 66 20 61 | 6e 20 65 6e 75 6d 65 72 |8...If a|n enumer|
|00001ac0| 61 74 69 6f 6e 20 69 73 | 20 6e 61 6d 65 64 20 69 |ation is| named i|
|00001ad0| 74 20 62 65 63 6f 6d 65 | 73 20 61 20 64 69 73 74 |t become|s a dist|
|00001ae0| 69 6e 63 74 20 74 79 70 | 65 2c 20 77 68 69 63 68 |inct typ|e, which|
|00001af0| 20 6d 61 79 20 62 65 20 | 63 61 73 74 20 61 75 74 | may be |cast aut|
|00001b00| 6f 6d 61 74 69 63 61 6c | 6c 79 20 74 6f 20 61 6e |omatical|ly to an|
|00001b10| 20 69 6e 74 2e 20 41 6e | 20 69 6e 74 20 6d 61 79 | int. An| int may|
|00001b20| 20 6f 6e 6c 79 20 62 65 | 20 63 61 73 74 20 65 78 | only be| cast ex|
|00001b30| 70 6c 69 63 69 74 6c 79 | 20 74 6f 20 61 6e 20 65 |plicitly| to an e|
|00001b40| 6e 75 6d 2c 20 73 69 6e | 63 65 20 6e 6f 20 72 61 |num, sin|ce no ra|
|00001b50| 6e 67 65 20 63 68 65 63 | 6b 69 6e 67 20 69 73 20 |nge chec|king is |
|00001b60| 70 65 72 66 6f 72 6d 65 | 64 2e 0a 0a 23 66 43 6f |performe|d...#fCo|
|00001b70| 64 65 0a 09 65 6e 75 6d | 20 44 69 73 74 69 6e 63 |de..enum| Distinc|
|00001b80| 74 54 79 70 65 20 5c 7b | 20 41 3d 30 2c 20 42 2c |tType \{| A=0, B,|
|00001b90| 20 43 7d 3b 0a 23 66 53 | 74 64 00 00 44 49 52 24 | C};.#fS|td..DIR$|
|00001ba0| ac 00 00 00 ac 00 00 00 | 48 1c 00 00 46 ff ff ff |........|H...F...|
|00001bb0| 29 a4 8b fa 26 02 00 00 | 13 00 00 00 00 00 00 00 |)...&...|........|
|00001bc0| 47 43 43 00 70 1e 00 00 | 46 ff ff ff 7a 7f 0e b5 |GCC.p...|F...z...|
|00001bd0| 84 02 00 00 13 00 00 00 | 00 00 00 00 67 6f 74 6f |........|....goto|
|00001be0| 00 00 00 00 f4 20 00 00 | 46 ff ff ff f7 1c 79 b3 |..... ..|F.....y.|
|00001bf0| b5 00 00 00 13 00 00 00 | 00 00 00 00 47 72 61 70 |........|....Grap|
|00001c00| 68 73 00 00 ac 21 00 00 | 46 ff ff ff 22 b1 79 b3 |hs...!..|F...".y.|
|00001c10| 26 01 00 00 13 00 00 00 | 00 00 00 00 48 69 6e 74 |&.......|....Hint|
|00001c20| 73 54 69 70 73 00 00 00 | d4 22 00 00 46 ff ff ff |sTips...|."..F...|
|00001c30| c7 cb f1 d2 bd 01 00 00 | 13 00 00 00 00 00 00 00 |........|........|
|00001c40| 69 6e 6c 69 6e 65 00 00 | 44 41 54 41 26 02 00 00 |inline..|DATA&...|
|00001c50| 48 65 6c 70 20 6f 6e 20 | 47 43 43 0a 47 43 43 20 |Help on |GCC.GCC |
|00001c60| 69 73 20 69 6e 20 74 68 | 65 20 70 75 62 6c 69 63 |is in th|e public|
|00001c70| 20 64 6f 6d 61 69 6e 20 | 61 6e 64 20 61 76 61 69 | domain |and avai|
|00001c80| 6c 61 62 6c 65 20 62 79 | 20 61 6e 6f 6e 79 6d 6f |lable by| anonymo|
|00001c90| 75 73 20 46 54 50 20 66 | 72 6f 6d 20 48 65 6e 73 |us FTP f|rom Hens|
|00001ca0| 61 20 61 6d 6f 6e 67 20 | 6f 74 68 65 72 20 70 6c |a among |other pl|
|00001cb0| 61 63 65 73 2e 20 54 68 | 65 20 6c 61 74 65 73 74 |aces. Th|e latest|
|00001cc0| 20 76 65 72 73 69 6f 6e | 20 69 73 20 32 2e 34 2e | version| is 2.4.|
|00001cd0| 35 20 72 65 6c 65 61 73 | 65 20 32 2e 32 2e 20 56 |5 releas|e 2.2. V|
|00001ce0| 65 72 73 69 6f 6e 20 32 | 2e 37 2e 32 20 72 65 6c |ersion 2|.7.2 rel|
|00001cf0| 65 61 73 65 0a 31 2e 30 | 32 20 69 73 20 61 6c 73 |ease.1.0|2 is als|
|00001d00| 6f 20 61 76 61 69 6c 61 | 62 6c 65 2c 20 62 75 74 |o availa|ble, but|
|00001d10| 20 64 6f 65 73 20 6e 6f | 74 20 69 6e 63 6c 75 64 | does no|t includ|
|00001d20| 65 20 43 2b 2b 20 6c 69 | 62 72 61 72 69 65 73 2e |e C++ li|braries.|
|00001d30| 0a 0a 49 74 65 6d 73 20 | 4e 4f 54 20 73 75 70 70 |..Items |NOT supp|
|00001d40| 6f 72 74 65 64 20 61 72 | 65 3a 0a 0a 65 78 63 65 |orted ar|e:..exce|
|00001d50| 70 74 69 6f 6e 73 2e 0a | 73 74 61 74 69 63 20 64 |ptions..|static d|
|00001d60| 61 74 61 20 69 6e 20 61 | 20 74 65 6d 70 6c 61 74 |ata in a| templat|
|00001d70| 65 20 63 6c 61 73 73 2e | 0a 0a 0a 47 43 43 20 72 |e class.|...GCC r|
|00001d80| 75 6e 73 20 66 72 6f 6d | 20 74 68 65 20 63 6f 6d |uns from| the com|
|00001d90| 6d 61 6e 64 20 6c 69 6e | 65 2c 20 61 6e 64 20 72 |mand lin|e, and r|
|00001da0| 65 71 75 69 72 65 73 20 | 61 62 6f 75 74 20 33 37 |equires |about 37|
|00001db0| 30 30 4b 20 6f 66 20 6d | 65 6d 6f 72 79 2e 20 41 |00K of m|emory. A|
|00001dc0| 20 73 69 6d 70 6c 65 20 | 69 6e 76 6f 63 61 74 69 | simple |invocati|
|00001dd0| 6f 6e 20 69 73 3a 0a 0a | 67 63 63 20 2d 6f 20 21 |on is:..|gcc -o !|
|00001de0| 52 75 6e 49 6d 61 67 65 | 20 74 65 73 74 2e 63 63 |RunImage| test.cc|
|00001df0| 20 2d 6c 63 2b 2b 0a 0a | 69 65 20 2d 20 63 6f 6d | -lc++..|ie - com|
|00001e00| 70 69 6c 65 20 74 65 73 | 74 2e 63 63 2c 20 70 75 |pile tes|t.cc, pu|
|00001e10| 74 20 74 68 65 20 72 65 | 73 75 6c 74 20 69 6e 20 |t the re|sult in |
|00001e20| 21 52 75 6e 49 6d 61 67 | 65 20 28 64 65 66 61 75 |!RunImag|e (defau|
|00001e30| 6c 74 20 69 73 20 61 2e | 6f 75 74 29 2c 20 61 6e |lt is a.|out), an|
|00001e40| 64 20 6c 69 6e 6b 20 69 | 74 20 77 69 74 68 20 74 |d link i|t with t|
|00001e50| 68 65 20 43 2b 2b 20 6c | 69 62 72 61 72 79 20 69 |he C++ l|ibrary i|
|00001e60| 6e 20 74 68 65 20 70 72 | 6f 63 65 73 73 2e 00 00 |n the pr|ocess...|
|00001e70| 44 41 54 41 84 02 00 00 | 67 6f 74 6f 0a 54 68 65 |DATA....|goto.The|
|00001e80| 20 67 6f 74 6f 20 73 74 | 61 74 65 6d 65 6e 74 20 | goto st|atement |
|00001e90| 74 72 61 6e 73 66 65 72 | 73 20 65 78 65 63 75 74 |transfer|s execut|
|00001ea0| 69 6f 6e 20 74 6f 20 61 | 20 70 6f 69 6e 74 20 7b |ion to a| point {|
|00001eb0| 2a 7d 69 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |*}in the| current|
|00001ec0| 20 66 75 6e 63 74 69 6f | 6e 7b 2a 7d 20 64 65 66 | functio|n{*} def|
|00001ed0| 69 6e 65 64 20 62 79 20 | 61 20 3c 6c 61 62 65 6c |ined by |a <label|
|00001ee0| 3e 2e 20 54 68 65 20 6c | 61 62 65 6c 20 6d 61 79 |>. The l|abel may|
|00001ef0| 20 62 65 20 75 73 65 64 | 20 62 65 66 6f 72 65 20 | be used| before |
|00001f00| 69 74 73 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 28 |its defi|nition (|
|00001f10| 63 66 2e 20 3c 73 77 69 | 74 63 68 3d 3e 43 3a 73 |cf. <swi|tch=>C:s|
|00001f20| 77 69 74 63 68 3e 29 2e | 20 41 20 73 77 69 74 63 |witch>).| A switc|
|00001f30| 68 20 73 74 61 74 65 6d | 65 6e 74 20 69 73 20 72 |h statem|ent is r|
|00001f40| 65 61 6c 6c 79 20 61 20 | 73 74 72 75 63 74 75 72 |eally a |structur|
|00001f50| 65 64 20 67 6f 74 6f 2e | 0a 0a 23 66 43 6f 64 65 |ed goto.|..#fCode|
|00001f60| 0a 23 49 6e 64 65 6e 74 | 20 33 0a 76 6f 69 64 20 |.#Indent| 3.void |
|00001f70| 66 75 6e 63 74 69 6f 6e | 28 76 6f 69 64 29 0a 5c |function|(void).\|
|00001f80| 7b 0a 23 49 6e 64 65 6e | 74 20 36 0a 09 67 6f 74 |{.#Inden|t 6..got|
|00001f90| 6f 20 74 65 73 74 5f 67 | 6f 74 6f 3b 0a 09 2f 2f |o test_g|oto;..//|
|00001fa0| 61 6e 79 20 73 74 61 74 | 65 6d 65 6e 74 20 68 65 |any stat|ement he|
|00001fb0| 72 65 20 6e 65 76 65 72 | 20 72 65 61 63 68 65 64 |re never| reached|
|00001fc0| 0a 09 74 65 73 74 5f 67 | 6f 74 6f 3a 0a 09 2f 2f |..test_g|oto:..//|
|00001fd0| 64 6f 20 73 6f 6d 65 74 | 68 69 6e 67 0a 09 72 65 |do somet|hing..re|
|00001fe0| 74 75 72 6e 3b 0a 23 49 | 6e 64 65 6e 74 20 33 0a |turn;.#I|ndent 3.|
|00001ff0| 7d 0a 23 49 6e 64 65 6e | 74 20 30 0a 23 66 53 74 |}.#Inden|t 0.#fSt|
|00002000| 64 0a 0a 54 68 69 73 20 | 73 74 61 74 65 6d 65 6e |d..This |statemen|
|00002010| 74 20 69 73 20 76 65 72 | 79 20 6f 70 65 6e 20 74 |t is ver|y open t|
|00002020| 6f 20 61 62 75 73 65 2c | 20 61 6e 64 20 77 69 6c |o abuse,| and wil|
|00002030| 6c 20 61 6c 6d 6f 73 74 | 20 6e 65 76 65 72 20 62 |l almost| never b|
|00002040| 65 20 66 6f 75 6e 64 20 | 69 6e 20 67 6f 6f 64 20 |e found |in good |
|00002050| 70 72 6f 67 72 61 6d 73 | 2e 20 49 74 20 69 73 20 |programs|. It is |
|00002060| 67 65 6e 65 72 61 6c 6c | 79 20 63 6f 6e 73 69 64 |generall|y consid|
|00002070| 65 72 65 64 20 76 65 72 | 79 20 62 61 64 20 73 74 |ered ver|y bad st|
|00002080| 79 6c 65 20 74 6f 20 75 | 73 65 20 67 6f 74 6f 2c |yle to u|se goto,|
|00002090| 20 77 69 74 68 6f 75 74 | 20 73 6f 6d 65 20 63 6f | without| some co|
|000020a0| 6d 70 65 6c 6c 69 6e 67 | 20 72 65 61 73 6f 6e 2c |mpelling| reason,|
|000020b0| 20 65 73 70 65 63 69 61 | 6c 6c 79 20 69 6e 20 43 | especia|lly in C|
|000020c0| 20 6f 72 20 43 2b 2b 20 | 77 68 65 72 65 20 74 68 | or C++ |where th|
|000020d0| 65 72 65 20 61 72 65 20 | 6d 61 6e 79 20 61 6c 74 |ere are |many alt|
|000020e0| 65 72 6e 61 74 69 76 65 | 73 20 61 76 61 69 6c 61 |ernative|s availa|
|000020f0| 62 6c 65 2e 44 41 54 41 | b5 00 00 00 47 72 61 70 |ble.DATA|....Grap|
|00002100| 68 73 0a 55 6e 72 6f 6f | 74 65 64 20 63 6f 6c 6c |hs.Unroo|ted coll|
|00002110| 65 63 74 69 6f 6e 20 6f | 66 20 6e 6f 64 65 73 20 |ection o|f nodes |
|00002120| 61 6e 64 20 61 72 63 73 | 2c 20 77 68 69 63 68 20 |and arcs|, which |
|00002130| 6d 61 79 20 63 6f 6e 74 | 61 69 6e 20 63 79 63 6c |may cont|ain cycl|
|00002140| 65 73 20 61 6e 64 20 63 | 72 6f 73 73 2d 72 65 66 |es and c|ross-ref|
|00002150| 65 72 65 6e 63 65 73 3b | 20 73 74 72 75 63 74 75 |erences;| structu|
|00002160| 72 61 6c 20 73 68 61 72 | 69 6e 67 20 69 73 20 70 |ral shar|ing is p|
|00002170| 65 72 6d 69 74 74 65 64 | 2e 0a 0a 47 72 61 70 68 |ermitted|...Graph|
|00002180| 73 20 63 6f 6d 65 20 69 | 6e 20 64 69 72 65 63 74 |s come i|n direct|
|00002190| 65 64 20 61 6e 64 20 75 | 6e 64 69 72 65 63 74 65 |ed and u|ndirecte|
|000021a0| 64 20 66 6f 72 6d 73 2e | 0a 00 00 00 44 41 54 41 |d forms.|....DATA|
|000021b0| 26 01 00 00 43 2b 2b 20 | 48 69 6e 74 73 20 61 6e |&...C++ |Hints an|
|000021c0| 64 20 54 69 70 73 0a 23 | 50 61 72 65 6e 74 20 53 |d Tips.#|Parent S|
|000021d0| 74 72 6f 6e 67 48 65 6c | 70 3a 21 4d 65 6e 75 0a |trongHel|p:!Menu.|
|000021e0| 41 20 66 65 77 20 68 69 | 6e 74 73 20 61 6e 64 20 |A few hi|nts and |
|000021f0| 74 69 70 73 20 6f 6e 20 | 76 61 72 69 6f 75 73 20 |tips on |various |
|00002200| 74 6f 70 69 63 73 0a 0a | 23 69 6e 64 65 6e 74 20 |topics..|#indent |
|00002210| 33 0a 49 6e 68 65 72 69 | 74 61 6e 63 65 0a 54 65 |3.Inheri|tance.Te|
|00002220| 6d 70 6c 61 74 65 73 0a | 45 78 63 65 70 74 69 6f |mplates.|Exceptio|
|00002230| 6e 73 0a 3c 44 61 74 61 | 20 53 74 72 75 63 74 75 |ns.<Data| Structu|
|00002240| 72 65 73 3d 3e 44 61 74 | 61 53 74 72 75 63 74 73 |res=>Dat|aStructs|
|00002250| 3e 0a 3c 41 6c 67 6f 72 | 69 74 68 6d 69 63 20 54 |>.<Algor|ithmic T|
|00002260| 6f 6f 6c 73 3d 3e 41 6c | 67 54 6f 6f 6c 73 3e 0a |ools=>Al|gTools>.|
|00002270| 3c 56 69 72 74 75 61 6c | 20 46 75 6e 63 74 69 6f |<Virtual| Functio|
|00002280| 6e 73 3d 3e 56 69 72 74 | 75 61 6c 46 75 6e 63 74 |ns=>Virt|ualFunct|
|00002290| 69 6f 6e 73 3e 0a 3c 53 | 6d 61 72 74 20 50 6f 69 |ions>.<S|mart Poi|
|000022a0| 6e 74 65 72 73 3d 3e 53 | 6d 61 72 74 50 6f 69 6e |nters=>S|martPoin|
|000022b0| 74 65 72 73 3e 0a 3c 53 | 6f 72 74 20 4d 65 74 68 |ters>.<S|ort Meth|
|000022c0| 6f 64 73 3d 3e 53 65 61 | 72 63 68 53 6f 72 74 73 |ods=>Sea|rchSorts|
|000022d0| 3e 0a 00 00 44 41 54 41 | bd 01 00 00 69 6e 6c 69 |>...DATA|....inli|
|000022e0| 6e 65 0a 2a 69 6e 6c 69 | 6e 65 2a 20 69 73 20 61 |ne.*inli|ne* is a|
|000022f0| 20 64 69 72 65 63 74 69 | 76 65 20 74 6f 20 74 68 | directi|ve to th|
|00002300| 65 20 63 6f 6d 70 69 6c | 65 72 20 74 6f 20 27 75 |e compil|er to 'u|
|00002310| 6e 72 6f 6c 6c 27 20 61 | 20 73 68 6f 72 74 20 66 |nroll' a| short f|
|00002320| 75 6e 63 74 69 6f 6e 20 | 69 6e 74 6f 20 74 68 65 |unction |into the|
|00002330| 20 63 6f 6d 70 69 6c 65 | 64 20 63 6f 64 65 2c 20 | compile|d code, |
|00002340| 69 6e 20 61 6e 20 61 74 | 74 65 6d 70 74 20 74 6f |in an at|tempt to|
|00002350| 20 67 61 69 6e 20 65 66 | 66 69 63 69 65 6e 63 79 | gain ef|ficiency|
|00002360| 2e 20 57 68 65 6e 20 61 | 20 66 75 6e 63 74 69 6f |. When a| functio|
|00002370| 6e 20 69 73 20 69 6e 6c | 69 6e 65 64 2c 20 74 68 |n is inl|ined, th|
|00002380| 65 72 65 20 69 73 20 4e | 4f 20 70 65 72 66 6f 72 |ere is N|O perfor|
|00002390| 6d 61 6e 63 65 20 63 6f | 73 74 20 69 6e 20 63 61 |mance co|st in ca|
|000023a0| 6c 6c 69 6e 67 20 74 68 | 61 74 20 66 75 6e 63 74 |lling th|at funct|
|000023b0| 69 6f 6e 2e 20 48 6f 77 | 65 76 65 72 2c 20 63 6f |ion. How|ever, co|
|000023c0| 64 65 20 73 69 7a 65 20 | 77 69 6c 6c 20 69 6e 63 |de size |will inc|
|000023d0| 72 65 61 73 65 2c 20 75 | 6e 6c 65 73 73 20 74 68 |rease, u|nless th|
|000023e0| 65 20 66 75 6e 63 74 69 | 6f 6e 20 69 73 20 74 72 |e functi|on is tr|
|000023f0| 69 76 69 61 6c 2c 20 6f | 72 20 69 73 20 72 61 72 |ivial, o|r is rar|
|00002400| 65 6c 79 20 63 61 6c 6c | 65 64 2e 0a 0a 4c 61 72 |ely call|ed...Lar|
|00002410| 67 65 20 66 75 6e 63 74 | 69 6f 6e 73 20 73 68 6f |ge funct|ions sho|
|00002420| 75 6c 64 20 6e 6f 74 20 | 62 65 20 69 6e 6c 69 6e |uld not |be inlin|
|00002430| 65 64 2e 20 41 20 66 75 | 6e 63 74 69 6f 6e 20 77 |ed. A fu|nction w|
|00002440| 68 69 63 68 20 63 61 6c | 6c 73 20 6e 65 77 20 63 |hich cal|ls new c|
|00002450| 61 6e 20 67 65 6e 65 72 | 61 74 65 20 61 20 6c 61 |an gener|ate a la|
|00002460| 72 67 65 20 61 6d 6f 75 | 6e 74 20 6f 66 20 63 6f |rge amou|nt of co|
|00002470| 64 65 2c 20 61 6e 64 20 | 73 68 6f 75 6c 64 20 72 |de, and |should r|
|00002480| 61 72 65 6c 79 20 62 65 | 20 69 6e 6c 69 6e 65 64 |arely be| inlined|
|00002490| 2e 00 00 00 44 49 52 24 | 8c 00 00 00 8c 00 00 00 |....DIR$|........|
|000024a0| 20 25 00 00 46 ff ff ff | d0 fa 0e b5 2b 02 00 00 | %..F...|....+...|
|000024b0| 13 00 00 00 00 00 00 00 | 6c 61 62 65 6c 00 00 00 |........|label...|
|000024c0| 4c 27 00 00 46 ff ff ff | 5f 25 7e b3 14 03 00 00 |L'..F...|_%~.....|
|000024d0| 13 00 00 00 00 00 00 00 | 4c 69 73 74 73 00 00 00 |........|Lists...|
|000024e0| 60 2a 00 00 46 ff ff ff | bc c1 78 b3 2f 00 00 00 |`*..F...|..x./...|
|000024f0| 13 00 00 00 00 00 00 00 | 4d 61 70 73 00 00 00 00 |........|Maps....|
|00002500| 90 2a 00 00 46 ff ff ff | e3 d3 6b ab 9a 03 00 00 |.*..F...|..k.....|
|00002510| 13 00 00 00 00 00 00 00 | 6d 65 6d 6f 72 79 00 00 |........|memory..|
|00002520| 44 41 54 41 2b 02 00 00 | 6c 61 62 65 6c 0a 4c 61 |DATA+...|label.La|
|00002530| 62 65 6c 20 69 73 20 6e | 6f 74 20 61 20 43 2b 2b |bel is n|ot a C++|
|00002540| 20 6b 65 79 77 6f 72 64 | 2c 20 62 75 74 20 72 65 | keyword|, but re|
|00002550| 66 65 72 73 20 74 6f 20 | 61 20 7b 2a 7d 6c 61 62 |fers to |a {*}lab|
|00002560| 65 6c 65 64 20 73 74 61 | 74 65 6d 65 6e 74 7b 2a |eled sta|tement{*|
|00002570| 7d 2e 20 54 68 65 73 65 | 20 68 61 76 65 20 74 68 |}. These| have th|
|00002580| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 67 72 61 6d |e follow|ing gram|
|00002590| 6d 61 72 3a 0a 0a 23 66 | 43 6f 64 65 0a 6c 61 62 |mar:..#f|Code.lab|
|000025a0| 65 6c 65 64 2d 73 74 61 | 74 65 6d 65 6e 74 3a 0a |eled-sta|tement:.|
|000025b0| 20 20 20 69 64 65 6e 74 | 69 66 69 65 72 20 3a 20 | ident|ifier : |
|000025c0| 73 74 61 74 65 6d 65 6e | 74 0a 20 20 20 3c 63 61 |statemen|t. <ca|
|000025d0| 73 65 3d 3e 43 3a 63 61 | 73 65 3e 20 63 6f 6e 73 |se=>C:ca|se> cons|
|000025e0| 74 61 6e 74 2d 65 78 70 | 72 65 73 73 69 6f 6e 20 |tant-exp|ression |
|000025f0| 3a 20 73 74 61 74 65 6d | 65 6e 74 0a 20 20 20 3c |: statem|ent. <|
|00002600| 64 65 66 61 75 6c 74 3d | 3e 43 3a 64 65 66 61 75 |default=|>C:defau|
|00002610| 6c 74 3e 20 3a 20 73 74 | 61 74 65 6d 65 6e 74 0a |lt> : st|atement.|
|00002620| 23 66 53 74 64 0a 0a 41 | 20 6c 61 62 65 6c 20 69 |#fStd..A| label i|
|00002630| 73 20 6f 6e 6c 79 20 65 | 76 65 72 20 75 73 65 64 |s only e|ver used|
|00002640| 20 61 73 20 74 68 65 20 | 74 61 72 67 65 74 20 6f | as the |target o|
|00002650| 66 20 61 20 67 6f 74 6f | 2e 20 41 20 63 61 73 65 |f a goto|. A case|
|00002660| 20 6f 72 20 64 65 66 61 | 75 6c 74 20 6c 61 62 65 | or defa|ult labe|
|00002670| 6c 20 6d 61 79 20 6f 6e | 6c 79 20 62 65 20 75 73 |l may on|ly be us|
|00002680| 65 64 20 69 6e 20 61 20 | 3c 73 77 69 74 63 68 3d |ed in a |<switch=|
|00002690| 3e 43 3a 73 77 69 74 63 | 68 3e 20 73 74 61 74 65 |>C:switc|h> state|
|000026a0| 6d 65 6e 74 2e 20 4c 61 | 62 65 6c 20 6e 61 6d 65 |ment. La|bel name|
|000026b0| 73 20 64 6f 20 6e 6f 74 | 20 69 6e 74 65 72 66 65 |s do not| interfe|
|000026c0| 72 65 20 77 69 74 68 20 | 6f 74 68 65 72 20 69 64 |re with |other id|
|000026d0| 65 6e 74 69 66 69 65 72 | 73 2c 20 61 73 20 74 68 |entifier|s, as th|
|000026e0| 65 79 20 61 72 65 20 73 | 74 6f 72 65 64 20 69 6e |ey are s|tored in|
|000026f0| 20 61 20 73 65 70 61 72 | 61 74 65 20 6e 61 6d 65 | a separ|ate name|
|00002700| 2d 73 70 61 63 65 2e 20 | 54 68 65 20 73 63 6f 70 |-space. |The scop|
|00002710| 65 20 6f 66 20 61 20 6c | 61 62 65 6c 20 69 73 20 |e of a l|abel is |
|00002720| 6c 69 6d 69 74 65 64 20 | 74 6f 20 74 68 65 20 66 |limited |to the f|
|00002730| 75 6e 63 74 69 6f 6e 20 | 69 6e 20 77 68 69 63 68 |unction |in which|
|00002740| 20 69 74 20 6f 63 63 75 | 72 73 2e 00 44 41 54 41 | it occu|rs..DATA|
|00002750| 14 03 00 00 4c 69 73 74 | 73 0a 52 6f 6f 74 65 64 |....List|s.Rooted|
|00002760| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 69 74 65 | sequenc|e of ite|
|00002770| 6d 73 3b 20 73 74 72 75 | 63 74 75 72 61 6c 20 73 |ms; stru|ctural s|
|00002780| 68 61 72 69 6e 67 20 69 | 73 20 70 65 72 6d 69 74 |haring i|s permit|
|00002790| 74 65 64 2e 0a 0a 4c 69 | 73 74 73 20 6d 61 79 20 |ted...Li|sts may |
|000027a0| 62 65 20 73 69 6e 67 6c | 79 20 6f 72 20 64 6f 75 |be singl|y or dou|
|000027b0| 62 6c 79 20 6c 69 6e 6b | 65 64 2e 20 0a 0a 55 73 |bly link|ed. ..Us|
|000027c0| 65 20 61 20 73 69 6e 67 | 6c 79 20 6c 69 6e 6b 65 |e a sing|ly linke|
|000027d0| 64 20 6c 69 73 74 20 77 | 68 65 6e 20 64 61 74 61 |d list w|hen data|
|000027e0| 20 69 73 20 69 6e 73 65 | 72 74 65 64 20 61 74 20 | is inse|rted at |
|000027f0| 61 6e 79 20 70 6f 69 6e | 74 2c 20 62 75 74 20 72 |any poin|t, but r|
|00002800| 65 6d 6f 76 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |emoved f|rom the |
|00002810| 68 65 61 64 20 6f 66 20 | 74 68 65 20 6c 69 73 74 |head of |the list|
|00002820| 20 6f 6e 6c 79 2e 20 55 | 73 65 20 61 20 73 69 6e | only. U|se a sin|
|00002830| 67 6c 79 20 6c 69 6e 6b | 65 64 20 6c 69 73 74 20 |gly link|ed list |
|00002840| 61 6c 73 6f 20 66 6f 72 | 20 6e 6f 6e 2d 73 70 65 |also for| non-spe|
|00002850| 65 64 20 63 72 69 74 69 | 63 61 6c 20 61 70 70 6c |ed criti|cal appl|
|00002860| 69 63 61 74 69 6f 6e 73 | 20 77 69 74 68 20 73 6d |ications| with sm|
|00002870| 61 6c 6c 20 61 6e 64 20 | 69 6e 73 74 65 72 6d 65 |all and |insterme|
|00002880| 64 69 61 74 65 20 6c 69 | 73 74 20 73 69 7a 65 73 |diate li|st sizes|
|00002890| 2e 0a 0a 0a 23 66 48 34 | 3a 53 74 61 6e 64 61 72 |....#fH4|:Standar|
|000028a0| 64 20 66 75 6e 63 74 69 | 6f 6e 73 0a 76 6f 69 64 |d functi|ons.void|
|000028b0| 09 61 64 64 28 52 65 63 | 6f 72 64 2a 2c 20 52 65 |.add(Rec|ord*, Re|
|000028c0| 63 6f 72 64 2a 20 62 65 | 66 6f 72 65 29 09 41 64 |cord* be|fore).Ad|
|000028d0| 64 20 61 20 72 65 63 6f | 72 64 20 61 66 74 65 72 |d a reco|rd after|
|000028e0| 20 61 20 73 70 65 63 69 | 66 69 65 64 20 72 65 63 | a speci|fied rec|
|000028f0| 6f 72 64 20 69 6e 20 74 | 68 65 20 6c 69 73 74 0a |ord in t|he list.|
|00002900| 76 6f 69 64 09 63 6c 65 | 61 72 28 76 6f 69 64 29 |void.cle|ar(void)|
|00002910| 09 09 09 09 09 09 43 6c | 65 61 72 20 61 6c 6c 20 |......Cl|ear all |
|00002920| 72 65 63 6f 72 64 73 20 | 66 72 6f 6d 20 74 68 65 |records |from the|
|00002930| 20 6c 73 74 0a 76 6f 69 | 64 09 72 65 6d 6f 76 65 | lst.voi|d.remove|
|00002940| 28 52 65 63 6f 72 64 2a | 29 09 09 09 09 09 52 65 |(Record*|).....Re|
|00002950| 6d 6f 76 65 20 61 20 72 | 65 63 6f 72 64 20 66 72 |move a r|ecord fr|
|00002960| 6f 6d 20 74 68 65 20 6c | 69 73 74 0a 0a 7b 2a 7d |om the l|ist..{*}|
|00002970| 54 68 65 73 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |These fu|nctions |
|00002980| 77 69 6c 6c 20 6e 6f 72 | 6d 61 6c 6c 79 20 62 65 |will nor|mally be|
|00002990| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 69 6e 20 | impleme|nted in |
|000029a0| 61 20 73 65 70 61 72 61 | 74 65 20 69 74 65 72 61 |a separa|te itera|
|000029b0| 74 6f 72 20 63 6c 61 73 | 73 7b 2a 7d 0a 52 65 63 |tor clas|s{*}.Rec|
|000029c0| 6f 72 64 2a 09 74 72 61 | 76 65 72 73 65 28 76 6f |ord*.tra|verse(vo|
|000029d0| 69 64 29 09 09 09 09 09 | 52 65 74 75 72 6e 20 74 |id).....|Return t|
|000029e0| 68 65 20 63 75 72 72 65 | 6e 74 20 72 65 63 6f 72 |he curre|nt recor|
|000029f0| 64 2c 20 61 6e 64 20 69 | 6e 63 72 65 6d 65 6e 74 |d, and i|ncrement|
|00002a00| 20 74 68 65 20 63 75 72 | 73 6f 72 0a 76 6f 69 64 | the cur|sor.void|
|00002a10| 09 72 65 73 65 74 28 76 | 6f 69 64 29 09 09 09 09 |.reset(v|oid)....|
|00002a20| 09 09 52 65 73 65 74 20 | 74 68 65 20 63 75 72 73 |..Reset |the curs|
|00002a30| 6f 72 20 74 6f 20 74 68 | 65 20 68 65 61 64 20 6f |or to th|e head o|
|00002a40| 66 20 74 68 65 20 6c 69 | 73 74 0a 0a 23 66 48 34 |f the li|st..#fH4|
|00002a50| 3a 49 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 0a |:Impleme|ntation.|
|00002a60| 44 41 54 41 2f 00 00 00 | 4d 61 70 73 0a 44 69 63 |DATA/...|Maps.Dic|
|00002a70| 74 69 6f 6e 61 72 79 20 | 6f 66 20 69 74 65 6d 2f |tionary |of item/|
|00002a80| 76 61 6c 75 65 20 70 61 | 69 72 73 0a 0a 0a 0a 00 |value pa|irs.....|
|00002a90| 44 41 54 41 9a 03 00 00 | 6d 65 6d 6f 72 79 2e 68 |DATA....|memory.h|
|00002aa0| 0a 7b 2a 7d 76 6f 69 64 | 2a 20 6d 65 6d 63 70 79 |.{*}void|* memcpy|
|00002ab0| 28 76 6f 69 64 2a 20 73 | 31 2c 20 63 6f 6e 73 74 |(void* s|1, const|
|00002ac0| 20 76 6f 69 64 2a 20 73 | 32 2c 20 69 6e 74 20 63 | void* s|2, int c|
|00002ad0| 2c 20 69 6e 74 20 6e 29 | 3b 7b 2a 7d 0a 23 69 6e |, int n)|;{*}.#in|
|00002ae0| 64 65 6e 74 20 33 0a 43 | 6f 70 79 20 63 68 61 72 |dent 3.C|opy char|
|00002af0| 61 63 74 65 72 73 20 66 | 72 6f 6d 20 73 32 20 74 |acters f|rom s2 t|
|00002b00| 6f 20 73 31 2c 20 73 74 | 6f 70 70 69 6e 67 20 61 |o s1, st|opping a|
|00002b10| 66 74 65 72 20 6e 20 63 | 68 61 72 61 63 74 65 72 |fter n c|haracter|
|00002b20| 73 2c 20 6f 72 20 74 68 | 65 20 66 69 72 73 74 20 |s, or th|e first |
|00002b30| 6f 63 63 75 72 65 6e 63 | 65 20 6f 66 20 63 2e 0a |occurenc|e of c..|
|00002b40| 52 65 74 75 72 6e 20 61 | 20 70 6f 69 6e 74 65 72 |Return a| pointer|
|00002b50| 20 74 6f 20 74 68 65 20 | 63 68 61 72 61 63 74 65 | to the |characte|
|00002b60| 72 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 63 20 69 6e |r follow|ing c in|
|00002b70| 20 73 31 2c 20 6f 72 20 | 4e 55 4c 4c 20 69 66 20 | s1, or |NULL if |
|00002b80| 6e 6f 20 6f 63 63 75 72 | 65 6e 63 65 20 6f 66 20 |no occur|ence of |
|00002b90| 63 20 77 61 73 20 66 6f | 75 6e 64 2e 20 63 20 69 |c was fo|und. c i|
|00002ba0| 73 20 63 6f 70 69 65 64 | 20 69 6e 74 6f 20 73 31 |s copied| into s1|
|00002bb0| 2e 0a 23 69 6e 64 65 6e | 74 3b 0a 0a 7b 2a 7d 76 |..#inden|t;..{*}v|
|00002bc0| 6f 69 64 2a 20 6d 65 6d | 63 70 79 28 76 6f 69 64 |oid* mem|cpy(void|
|00002bd0| 2a 20 73 31 2c 20 63 6f | 6e 73 74 20 76 6f 69 64 |* s1, co|nst void|
|00002be0| 2a 20 73 32 2c 20 73 69 | 7a 65 5f 74 20 6e 29 3b |* s2, si|ze_t n);|
|00002bf0| 7b 2a 7d 0a 23 69 6e 64 | 65 6e 74 20 33 0a 43 6f |{*}.#ind|ent 3.Co|
|00002c00| 70 79 20 6e 20 63 68 61 | 72 61 63 74 65 72 73 20 |py n cha|racters |
|00002c10| 66 72 6f 6d 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |from the| object |
|00002c20| 70 6f 69 6e 74 65 64 20 | 74 6f 20 62 79 20 73 32 |pointed |to by s2|
|00002c30| 20 74 6f 20 74 68 61 74 | 20 70 6f 69 6e 74 65 64 | to that| pointed|
|00002c40| 20 74 6f 20 62 79 20 73 | 31 2e 20 43 6f 70 79 69 | to by s|1. Copyi|
|00002c50| 6e 67 20 62 65 74 77 65 | 65 6e 20 6f 76 65 72 6c |ng betwe|en overl|
|00002c60| 61 70 70 69 6e 67 20 6f | 62 6a 65 63 74 73 20 68 |apping o|bjects h|
|00002c70| 61 73 20 75 6e 64 65 66 | 69 6e 65 20 64 72 65 73 |as undef|ine dres|
|00002c80| 75 6c 74 73 2e 0a 52 65 | 74 75 72 6e 73 20 73 31 |ults..Re|turns s1|
|00002c90| 2e 0a 23 69 6e 64 65 6e | 74 3b 0a 0a 7b 2a 7d 76 |..#inden|t;..{*}v|
|00002ca0| 6f 69 64 2a 20 6d 65 6d | 73 65 74 28 76 6f 69 64 |oid* mem|set(void|
|00002cb0| 2a 20 73 2c 20 69 6e 74 | 20 63 2c 20 73 69 7a 65 |* s, int| c, size|
|00002cc0| 5f 74 20 6e 29 3b 7b 2a | 7d 0a 23 69 6e 64 65 6e |_t n);{*|}.#inden|
|00002cd0| 74 20 33 0a 57 72 69 74 | 65 20 63 20 69 6e 74 6f |t 3.Writ|e c into|
|00002ce0| 20 74 68 65 20 66 69 72 | 73 74 20 6e 20 63 68 61 | the fir|st n cha|
|00002cf0| 72 61 63 74 65 72 73 20 | 6f 66 20 74 68 65 20 6f |racters |of the o|
|00002d00| 62 6a 65 63 20 70 6f 69 | 6e 74 65 64 20 74 6f 20 |bjec poi|nted to |
|00002d10| 62 79 20 73 2e 0a 52 65 | 74 75 72 6e 73 20 73 2e |by s..Re|turns s.|
|00002d20| 0a 23 69 6e 64 65 6e 74 | 3b 0a 0a 7b 2a 7d 76 6f |.#indent|;..{*}vo|
|00002d30| 69 64 2a 20 6d 65 6d 63 | 68 72 28 63 6f 6e 73 74 |id* memc|hr(const|
|00002d40| 20 76 6f 69 64 2a 20 73 | 2c 20 69 6e 74 20 63 2c | void* s|, int c,|
|00002d50| 20 73 69 7a 65 5f 74 20 | 6e 29 3b 7b 2a 7d 0a 23 | size_t |n);{*}.#|
|00002d60| 69 6e 64 65 6e 74 20 33 | 0a 46 69 6e 64 20 74 68 |indent 3|.Find th|
|00002d70| 65 20 66 69 72 73 74 20 | 6f 63 63 75 72 65 6e 63 |e first |occurenc|
|00002d80| 65 20 6f 66 20 63 20 28 | 63 6f 6e 76 65 72 74 65 |e of c (|converte|
|00002d90| 64 20 74 6f 20 75 6e 73 | 69 67 6e 65 64 20 63 68 |d to uns|igned ch|
|00002da0| 61 72 29 20 69 6e 20 74 | 68 65 20 69 6e 69 74 69 |ar) in t|he initi|
|00002db0| 61 6c 20 6e 20 63 68 61 | 72 61 63 74 65 72 73 20 |al n cha|racters |
|00002dc0| 6f 66 20 74 68 65 20 6f | 62 6a 65 63 74 20 70 6f |of the o|bject po|
|00002dd0| 69 6e 74 65 64 20 74 6f | 20 62 79 20 73 2e 0a 52 |inted to| by s..R|
|00002de0| 65 74 75 72 6e 73 20 61 | 20 70 6f 69 6e 74 65 72 |eturns a| pointer|
|00002df0| 20 74 6f 20 74 68 65 20 | 6c 6f 63 61 74 65 64 20 | to the |located |
|00002e00| 63 68 61 72 61 63 74 65 | 72 2c 20 6f 72 20 4e 55 |characte|r, or NU|
|00002e10| 4c 4c 20 69 73 20 6e 6f | 6e 65 20 66 6f 75 6e 64 |LL is no|ne found|
|00002e20| 2e 0a 23 69 6e 64 65 6e | 74 3b 00 00 44 49 52 24 |..#inden|t;..DIR$|
|00002e30| ac 01 00 00 ac 01 00 00 | d8 2f 00 00 46 ff ff ff |........|./..F...|
|00002e40| 26 6d 62 ab 2b 04 00 00 | 13 00 00 00 00 00 00 00 |&mb.+...|........|
|00002e50| 50 72 69 76 61 74 65 49 | 6e 68 65 72 69 74 61 6e |PrivateI|nheritan|
|00002e60| 63 65 00 00 04 34 00 00 | 46 ff ff ff 2a 29 07 d3 |ce...4..|F...*)..|
|00002e70| ca 04 00 00 13 00 00 00 | 00 00 00 00 51 75 65 75 |........|....Queu|
|00002e80| 65 73 00 00 d0 38 00 00 | 46 ff ff ff 1e d8 78 b3 |es...8..|F.....x.|
|00002e90| 70 00 00 00 13 00 00 00 | 00 00 00 00 52 69 6e 67 |p.......|....Ring|
|00002ea0| 73 00 00 00 40 39 00 00 | 46 ff ff ff d9 42 7c d3 |s...@9..|F....B|.|
|00002eb0| fe 06 00 00 13 00 00 00 | 00 00 00 00 53 65 61 72 |........|....Sear|
|00002ec0| 63 68 53 6f 72 74 73 00 | 40 40 00 00 46 ff ff ff |chSorts.|@@..F...|
|00002ed0| 53 e7 78 b3 33 00 00 00 | 13 00 00 00 00 00 00 00 |S.x.3...|........|
|00002ee0| 53 65 74 73 00 00 00 00 | 74 40 00 00 46 ff ff ff |Sets....|t@..F...|
|00002ef0| 6f 66 10 b5 e5 01 00 00 | 13 00 00 00 00 00 00 00 |of......|........|
|00002f00| 73 69 7a 65 6f 66 76 61 | 72 00 00 00 5c 42 00 00 |sizeofva|r...\B..|
|00002f10| 46 ff ff ff ce ba c2 ab | 6c 03 00 00 13 00 00 00 |F.......|l.......|
|00002f20| 00 00 00 00 53 6d 61 72 | 74 50 6f 69 6e 74 65 72 |....Smar|tPointer|
|00002f30| 73 00 00 00 c8 45 00 00 | 46 ff ff ff dd 20 07 d3 |s....E..|F.... ..|
|00002f40| 51 03 00 00 13 00 00 00 | 00 00 00 00 53 74 61 63 |Q.......|....Stac|
|00002f50| 6b 73 00 00 1c 49 00 00 | 46 ff ff ff 54 25 6c ab |ks...I..|F...T%l.|
|00002f60| 66 01 00 00 13 00 00 00 | 00 00 00 00 53 74 61 6e |f.......|....Stan|
|00002f70| 64 61 72 64 43 2b 2b 4c | 69 62 00 00 84 4a 00 00 |dardC++L|ib...J..|
|00002f80| 46 ff ff ff a2 27 a2 b3 | d6 01 00 00 13 00 00 00 |F....'..|........|
|00002f90| 00 00 00 00 53 54 4c 00 | 5c 4c 00 00 46 ff ff ff |....STL.|\L..F...|
|00002fa0| 3e f3 78 b3 69 00 00 00 | 13 00 00 00 00 00 00 00 |>.x.i...|........|
|00002fb0| 53 74 72 69 6e 67 73 00 | c8 4c 00 00 46 ff ff ff |Strings.|.L..F...|
|00002fc0| 17 cf f2 d2 1f 02 00 00 | 13 00 00 00 00 00 00 00 |........|........|
|00002fd0| 72 65 6c 69 63 00 00 00 | 44 41 54 41 2b 04 00 00 |relic...|DATA+...|
|00002fe0| 50 72 69 76 61 74 65 2c | 20 50 72 6f 74 65 63 74 |Private,| Protect|
|00002ff0| 65 64 2c 20 61 6e 64 20 | 50 75 62 6c 69 63 20 49 |ed, and |Public I|
|00003000| 6e 68 65 72 69 74 61 6e | 63 65 0a 54 68 65 20 64 |nheritan|ce.The d|
|00003010| 65 66 61 75 6c 74 20 69 | 6e 68 65 72 69 74 61 6e |efault i|nheritan|
|00003020| 63 65 20 6f 66 20 61 20 | 63 6c 61 73 73 20 69 73 |ce of a |class is|
|00003030| 20 70 75 62 6c 69 63 2c | 0a 68 6f 77 65 76 65 72 | public,|.however|
|00003040| 20 6f 74 68 65 72 20 74 | 79 70 65 73 20 61 72 65 | other t|ypes are|
|00003050| 20 70 6f 73 73 69 62 6c | 65 2e 20 54 68 65 20 69 | possibl|e. The i|
|00003060| 6e 68 65 72 69 74 61 6e | 63 65 0a 74 79 70 65 20 |nheritan|ce.type |
|00003070| 61 66 66 65 63 74 73 20 | 64 6f 77 6e 2d 63 61 73 |affects |down-cas|
|00003080| 74 69 6e 67 20 74 6f 20 | 61 20 62 61 73 65 20 63 |ting to |a base c|
|00003090| 6c 61 73 73 20 2d 20 74 | 68 69 73 20 69 6e 0a 74 |lass - t|his in.t|
|000030a0| 75 72 6e 73 20 61 66 66 | 65 63 74 73 20 61 63 63 |urns aff|ects acc|
|000030b0| 65 73 73 20 74 6f 20 63 | 6c 61 73 73 20 66 75 6e |ess to c|lass fun|
|000030c0| 74 69 6f 6e 73 20 61 6e | 64 20 64 61 74 61 0a 0a |tions an|d data..|
|000030d0| 23 66 48 34 3a 50 72 69 | 76 61 74 65 20 49 6e 68 |#fH4:Pri|vate Inh|
|000030e0| 65 72 69 74 61 6e 63 65 | 0a 50 72 69 76 61 74 65 |eritance|.Private|
|000030f0| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 2c 20 73 70 | inherit|ance, sp|
|00003100| 65 63 69 66 69 65 64 20 | 62 79 0a 23 66 43 6f 64 |ecified |by.#fCod|
|00003110| 65 0a 63 6c 61 73 73 20 | 41 20 3a 20 70 72 69 76 |e.class |A : priv|
|00003120| 61 74 65 20 42 0a 23 66 | 53 74 64 0a 6d 65 61 6e |ate B.#f|Std.mean|
|00003130| 73 20 74 68 61 74 20 6f | 6e 6c 79 20 6d 65 6d 62 |s that o|nly memb|
|00003140| 65 72 73 20 61 6e 64 20 | 66 72 69 65 6e 64 73 20 |ers and |friends |
|00003150| 6f 66 20 63 6c 61 73 73 | 0a 41 20 20 6d 61 79 20 |of class|.A may |
|00003160| 63 6f 6e 76 65 72 74 20 | 61 20 70 6f 69 6e 74 65 |convert |a pointe|
|00003170| 72 20 6f 66 20 74 79 70 | 65 20 41 2a 20 74 6f 20 |r of typ|e A* to |
|00003180| 61 20 42 20 77 68 65 72 | 65 20 6e 65 63 65 73 73 |a B wher|e necess|
|00003190| 61 72 79 2e 0a 43 6f 6e | 73 65 71 75 65 6e 74 6c |ary..Con|sequentl|
|000031a0| 79 2c 20 6f 6e 6c 79 20 | 73 75 63 68 20 63 6c 61 |y, only |such cla|
|000031b0| 73 73 65 73 20 6d 61 79 | 20 61 63 63 65 73 73 20 |sses may| access |
|000031c0| 74 68 65 20 70 75 62 6c | 69 63 20 66 75 6e 63 74 |the publ|ic funct|
|000031d0| 69 6f 6e 73 0a 61 6e 64 | 20 64 61 74 61 20 61 74 |ions.and| data at|
|000031e0| 74 72 69 62 75 74 65 73 | 20 6f 66 20 63 6c 61 73 |tributes| of clas|
|000031f0| 73 20 42 2e 20 49 6e 20 | 65 66 66 65 63 74 2c 20 |s B. In |effect, |
|00003200| 42 27 73 20 70 75 62 6c | 69 63 20 6d 65 6d 62 65 |B's publ|ic membe|
|00003210| 72 73 0a 68 61 76 65 20 | 62 65 63 6f 6d 65 20 41 |rs.have |become A|
|00003220| 27 73 20 70 72 69 76 61 | 74 65 20 6d 65 6d 62 65 |'s priva|te membe|
|00003230| 72 73 2e 0a 0a 23 66 48 | 34 3a 50 72 6f 74 65 63 |rs...#fH|4:Protec|
|00003240| 74 65 64 20 49 6e 68 65 | 72 69 74 61 6e 63 65 0a |ted Inhe|ritance.|
|00003250| 50 72 6f 74 65 63 74 65 | 64 20 69 6e 68 65 72 69 |Protecte|d inheri|
|00003260| 74 61 6e 63 65 20 69 73 | 20 61 73 20 70 65 72 20 |tance is| as per |
|00003270| 70 72 69 76 61 74 65 20 | 69 6e 68 65 72 69 74 61 |private |inherita|
|00003280| 6e 63 65 2c 20 65 78 63 | 65 70 74 0a 74 68 61 74 |nce, exc|ept.that|
|00003290| 20 6d 65 6d 62 65 72 73 | 20 61 6e 64 20 66 72 69 | members| and fri|
|000032a0| 65 6e 64 73 20 6f 66 20 | 63 6c 61 73 73 65 73 20 |ends of |classes |
|000032b0| 64 65 72 69 76 65 64 20 | 66 72 6f 6d 20 41 20 6d |derived |from A m|
|000032c0| 61 79 20 61 6c 73 6f 20 | 63 61 73 74 0a 41 2a 20 |ay also |cast.A* |
|000032d0| 74 6f 20 42 2e 20 54 68 | 75 73 2c 20 74 68 65 20 |to B. Th|us, the |
|000032e0| 70 75 62 6c 69 63 20 6d | 65 6d 62 65 72 73 20 6f |public m|embers o|
|000032f0| 66 20 63 6c 61 73 73 20 | 42 20 68 61 76 65 20 62 |f class |B have b|
|00003300| 65 63 6f 6d 65 20 41 27 | 73 0a 70 72 6f 74 65 63 |ecome A'|s.protec|
|00003310| 74 65 64 20 6d 65 6d 62 | 65 72 73 2e 0a 0a 23 66 |ted memb|ers...#f|
|00003320| 48 34 3a 50 75 62 6c 69 | 63 20 49 6e 68 65 72 69 |H4:Publi|c Inheri|
|00003330| 74 61 6e 63 65 0a 54 68 | 69 73 20 69 73 20 74 68 |tance.Th|is is th|
|00003340| 65 20 64 65 66 61 75 6c | 74 20 69 6e 68 65 72 69 |e defaul|t inheri|
|00003350| 74 61 6e 63 65 20 77 68 | 65 72 65 20 6e 6f 20 6d |tance wh|ere no m|
|00003360| 6f 64 69 66 69 65 72 20 | 69 73 20 73 70 65 63 69 |odifier |is speci|
|00003370| 66 69 65 64 2c 0a 61 6e | 64 20 61 6c 6c 6f 77 73 |fied,.an|d allows|
|00003380| 20 74 68 65 20 73 61 6d | 65 20 61 63 63 65 73 73 | the sam|e access|
|00003390| 20 61 73 20 69 6e 20 63 | 6c 61 73 73 20 42 20 28 | as in c|lass B (|
|000033a0| 65 78 63 65 70 74 2c 20 | 6f 66 20 63 6f 75 72 73 |except, |of cours|
|000033b0| 65 2c 20 66 6f 72 0a 70 | 72 69 76 61 74 65 20 6d |e, for.p|rivate m|
|000033c0| 65 6d 62 65 72 73 29 2e | 20 41 6e 79 20 66 75 6e |embers).| Any fun|
|000033d0| 63 74 69 6f 6e 20 6d 61 | 79 20 63 61 73 74 20 41 |ction ma|y cast A|
|000033e0| 2a 20 74 6f 20 42 2c 20 | 61 6e 64 20 61 63 63 65 |* to B, |and acce|
|000033f0| 73 73 20 74 68 65 0a 70 | 75 62 6c 69 63 20 64 61 |ss the.p|ublic da|
|00003400| 74 61 2e 00 44 41 54 41 | ca 04 00 00 51 75 65 75 |ta..DATA|....Queu|
|00003410| 65 73 0a 53 65 71 75 65 | 6e 63 65 20 6f 66 20 69 |es.Seque|nce of i|
|00003420| 74 65 6d 73 20 69 6e 20 | 77 68 69 63 68 20 69 74 |tems in |which it|
|00003430| 65 6d 73 20 6d 61 79 20 | 62 65 20 61 64 64 65 64 |ems may |be added|
|00003440| 20 66 72 6f 6d 20 6f 6e | 65 20 65 6e 64 20 61 6e | from on|e end an|
|00003450| 64 20 72 65 6d 6f 76 65 | 64 20 66 72 6f 6d 20 74 |d remove|d from t|
|00003460| 68 65 20 6f 70 70 6f 73 | 69 74 65 20 65 6e 64 2e |he oppos|ite end.|
|00003470| 20 49 74 20 69 6d 70 6c | 65 6d 65 6e 74 73 20 74 | It impl|ements t|
|00003480| 68 65 20 63 68 61 72 61 | 63 74 65 72 69 73 74 69 |he chara|cteristi|
|00003490| 63 20 46 49 46 4f 20 28 | 66 69 72 73 74 20 69 6e |c FIFO (|first in|
|000034a0| 20 66 69 72 73 74 20 6f | 75 74 29 2e 0a 0a 23 66 | first o|ut)...#f|
|000034b0| 48 34 3a 53 74 61 6e 64 | 61 72 64 20 66 75 6e 63 |H4:Stand|ard func|
|000034c0| 74 69 6f 6e 73 0a 76 6f | 69 64 20 09 61 64 64 28 |tions.vo|id .add(|
|000034d0| 52 65 63 6f 72 64 2a 29 | 09 41 64 64 20 61 6e 20 |Record*)|.Add an |
|000034e0| 69 74 65 6d 20 74 6f 20 | 74 68 65 20 65 6e 64 20 |item to |the end |
|000034f0| 6f 66 20 74 68 65 20 71 | 75 65 75 65 0a 76 6f 69 |of the q|ueue.voi|
|00003500| 64 20 09 63 6c 65 61 72 | 28 76 6f 69 64 29 20 20 |d .clear|(void) |
|00003510| 20 09 52 65 6d 6f 76 65 | 20 61 6c 6c 20 69 74 65 | .Remove| all ite|
|00003520| 6d 73 20 66 72 6f 6d 20 | 74 68 65 20 71 75 65 75 |ms from |the queu|
|00003530| 65 0a 76 6f 69 64 20 09 | 72 65 6d 6f 76 65 28 52 |e.void .|remove(R|
|00003540| 65 63 6f 72 64 2a 29 09 | 47 65 74 20 74 68 65 20 |ecord*).|Get the |
|00003550| 69 74 65 6d 20 6f 6e 20 | 74 68 65 20 66 72 6f 6e |item on |the fron|
|00003560| 74 20 6f 66 20 74 68 65 | 20 71 75 65 75 65 20 28 |t of the| queue (|
|00003570| 72 65 6d 6f 76 69 6e 67 | 20 69 74 20 66 72 6f 6d |removing| it from|
|00003580| 20 74 68 65 20 71 75 65 | 75 65 29 0a 52 65 63 6f | the que|ue).Reco|
|00003590| 72 64 2a 09 66 72 6f 6e | 74 28 76 6f 69 64 29 09 |rd*.fron|t(void).|
|000035a0| 09 47 65 74 20 74 68 65 | 20 69 74 65 6d 20 6f 6e |.Get the| item on|
|000035b0| 20 74 68 65 20 66 72 6f | 6e 74 20 6f 66 20 74 68 | the fro|nt of th|
|000035c0| 65 20 71 75 65 75 65 0a | 0a 23 66 48 34 3a 49 6d |e queue.|.#fH4:Im|
|000035d0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 61 73 20 |plementa|tion as |
|000035e0| 61 20 63 69 72 63 75 6c | 61 72 20 61 72 72 61 79 |a circul|ar array|
|000035f0| 0a 55 73 65 20 74 68 69 | 73 20 69 6d 70 6c 65 6d |.Use thi|s implem|
|00003600| 65 6e 74 61 74 69 6f 6e | 20 77 68 65 6e 20 74 68 |entation| when th|
|00003610| 65 20 71 75 65 75 65 20 | 73 69 7a 65 20 69 73 20 |e queue |size is |
|00003620| 6b 6e 6f 77 6e 20 69 6e | 20 61 64 76 61 6e 63 65 |known in| advance|
|00003630| 2c 20 6f 72 20 69 66 20 | 73 70 65 65 64 20 69 73 |, or if |speed is|
|00003640| 20 6e 6f 74 20 61 6e 20 | 69 73 73 75 65 2e 20 49 | not an |issue. I|
|00003650| 74 20 63 61 6e 20 67 72 | 6f 77 20 64 79 6e 61 6d |t can gr|ow dynam|
|00003660| 69 63 61 6c 6c 79 20 69 | 66 20 72 65 71 75 69 72 |ically i|f requir|
|00003670| 65 64 2c 20 62 75 74 20 | 65 61 63 68 20 64 79 6e |ed, but |each dyn|
|00003680| 61 6d 69 63 20 67 72 6f | 77 74 68 20 6f 72 20 73 |amic gro|wth or s|
|00003690| 68 72 69 6e 6b 20 77 69 | 6c 6c 20 74 61 6b 65 20 |hrink wi|ll take |
|000036a0| 61 20 63 6f 6e 73 69 64 | 65 72 61 62 6c 65 20 61 |a consid|erable a|
|000036b0| 6d 6f 75 6e 74 20 6f 66 | 20 74 69 6d 65 2e 0a 0a |mount of| time...|
|000036c0| 44 61 74 61 3a 0a 09 61 | 72 72 61 79 20 6f 66 20 |Data:..a|rray of |
|000036d0| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 64 61 74 61 |pointers| to data|
|000036e0| 0a 09 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 6f 70 |..pointe|r to top|
|000036f0| 20 6f 66 20 64 61 74 61 | 0a 09 70 6f 69 6e 74 65 | of data|..pointe|
|00003700| 72 20 74 6f 20 62 6f 74 | 74 6f 6d 20 6f 66 20 64 |r to bot|tom of d|
|00003710| 61 74 61 0a 09 73 69 7a | 65 20 6f 66 20 61 72 72 |ata..siz|e of arr|
|00003720| 61 79 0a 0a 4d 65 6d 6f | 72 79 20 4f 76 65 72 68 |ay..Memo|ry Overh|
|00003730| 65 61 64 3a 20 31 32 20 | 62 79 74 65 73 0a 0a 23 |ead: 12 |bytes..#|
|00003740| 66 48 34 3a 49 6d 70 6c | 65 6d 65 6e 74 61 74 69 |fH4:Impl|ementati|
|00003750| 6f 6e 20 61 73 20 61 20 | 6c 69 73 74 20 28 73 69 |on as a |list (si|
|00003760| 6e 67 6c 79 20 6c 69 6e | 6b 65 64 29 2e 0a 55 73 |ngly lin|ked)..Us|
|00003770| 65 20 74 68 69 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |e this i|mplement|
|00003780| 61 74 69 6f 6e 20 77 68 | 65 6e 20 74 68 65 20 73 |ation wh|en the s|
|00003790| 69 7a 65 20 6f 66 20 74 | 68 65 20 71 75 65 75 65 |ize of t|he queue|
|000037a0| 20 77 69 6c 6c 20 63 68 | 61 6e 67 65 20 66 72 65 | will ch|ange fre|
|000037b0| 71 75 65 6e 74 6c 79 2e | 0a 0a 44 61 74 61 3a 0a |quently.|..Data:.|
|000037c0| 09 69 6e 64 69 76 69 64 | 75 61 6c 20 6c 69 73 74 |.individ|ual list|
|000037d0| 20 6e 6f 64 65 73 20 63 | 6f 6e 73 69 73 74 69 6e | nodes c|onsistin|
|000037e0| 67 20 6f 66 3a 0a 09 09 | 70 6f 69 6e 74 65 72 20 |g of:...|pointer |
|000037f0| 74 6f 20 64 61 74 61 0a | 09 09 70 6f 69 6e 74 65 |to data.|..pointe|
|00003800| 72 20 74 6f 20 6e 6f 64 | 65 20 69 6d 6d 65 64 69 |r to nod|e immedi|
|00003810| 61 74 65 6c 79 20 62 65 | 68 69 6e 64 20 69 6e 20 |ately be|hind in |
|00003820| 71 75 65 75 65 0a 0a 09 | 70 6f 69 6e 74 65 72 20 |queue...|pointer |
|00003830| 74 6f 20 6c 61 73 74 20 | 6c 69 73 74 20 6e 6f 64 |to last |list nod|
|00003840| 65 20 69 6e 20 71 75 65 | 75 65 20 28 6f 70 74 69 |e in que|ue (opti|
|00003850| 6f 6e 61 6c 2c 20 62 75 | 74 20 68 69 67 68 6c 79 |onal, bu|t highly|
|00003860| 20 72 65 63 6f 6d 6d 65 | 6e 64 65 64 20 66 6f 72 | recomme|nded for|
|00003870| 20 73 70 65 65 64 29 0a | 09 70 6f 69 6e 74 65 72 | speed).|.pointer|
|00003880| 20 74 6f 20 66 69 72 73 | 74 20 6c 69 73 74 20 6e | to firs|t list n|
|00003890| 6f 64 65 20 69 6e 20 71 | 75 65 75 65 0a 0a 4d 65 |ode in q|ueue..Me|
|000038a0| 6d 6f 72 79 20 6f 76 65 | 72 68 65 61 64 3a 20 38 |mory ove|rhead: 8|
|000038b0| 20 62 79 74 65 73 20 70 | 6c 75 73 20 34 20 62 79 | bytes p|lus 4 by|
|000038c0| 74 65 73 20 70 65 72 20 | 69 74 65 6d 2e 0a 00 00 |tes per |item....|
|000038d0| 44 41 54 41 70 00 00 00 | 52 69 6e 67 73 0a 53 65 |DATAp...|Rings.Se|
|000038e0| 71 75 65 6e 63 65 20 6f | 66 20 69 74 65 6d 73 20 |quence o|f items |
|000038f0| 69 6e 20 77 68 69 63 68 | 20 69 74 65 6d 73 20 6d |in which| items m|
|00003900| 61 79 20 62 65 20 61 64 | 64 65 64 20 61 6e 64 20 |ay be ad|ded and |
|00003910| 72 65 6d 6f 76 65 64 20 | 66 72 6f 6d 20 74 68 65 |removed |from the|
|00003920| 20 74 6f 70 20 6f 66 20 | 61 20 63 69 72 63 75 6c | top of |a circul|
|00003930| 61 72 20 73 74 72 75 63 | 74 75 72 65 2e 0a 0a 0a |ar struc|ture....|
|00003940| 44 41 54 41 fe 06 00 00 | 53 65 61 72 63 68 20 61 |DATA....|Search a|
|00003950| 6e 64 20 53 6f 72 74 20 | 4d 65 74 68 6f 64 73 0a |nd Sort |Methods.|
|00003960| 54 68 65 72 65 20 61 72 | 65 20 73 65 76 65 72 61 |There ar|e severa|
|00003970| 6c 20 6b 69 6e 64 73 20 | 6f 66 20 73 65 61 72 63 |l kinds |of searc|
|00003980| 68 73 20 61 6e 64 20 73 | 6f 72 74 73 20 70 6f 73 |hs and s|orts pos|
|00003990| 73 69 62 6c 65 20 69 6e | 20 61 6e 79 20 6c 61 6e |sible in| any lan|
|000039a0| 67 75 61 67 65 2e 20 54 | 68 65 20 61 6c 67 6f 72 |guage. T|he algor|
|000039b0| 69 74 68 6d 73 20 64 65 | 73 63 72 69 62 65 64 20 |ithms de|scribed |
|000039c0| 68 65 72 65 20 61 72 65 | 20 6e 6f 74 20 43 2b 2b |here are| not C++|
|000039d0| 20 73 70 65 63 69 66 69 | 63 2e 0a 0a 23 54 61 62 | specifi|c...#Tab|
|000039e0| 6c 65 20 6c 69 6e 65 73 | 20 34 0a 3c 42 75 62 62 |le lines| 4.<Bubb|
|000039f0| 6c 65 20 53 6f 72 74 3d | 3e 2e 42 75 62 62 6c 65 |le Sort=|>.Bubble|
|00003a00| 53 6f 72 74 3e 0a 3c 51 | 75 69 63 6b 20 53 6f 72 |Sort>.<Q|uick Sor|
|00003a10| 74 3d 3e 2e 51 75 69 63 | 6b 53 6f 72 74 3e 0a 49 |t=>.Quic|kSort>.I|
|00003a20| 6e 73 65 72 74 69 6f 6e | 20 53 6f 72 74 0a 48 65 |nsertion| Sort.He|
|00003a30| 61 70 20 53 6f 72 74 0a | 42 69 6e 61 72 79 20 54 |ap Sort.|Binary T|
|00003a40| 72 65 65 0a 48 61 73 68 | 20 54 61 62 6c 65 0a 23 |ree.Hash| Table.#|
|00003a50| 45 6e 64 74 61 62 6c 65 | 0a 23 53 75 62 70 61 67 |Endtable|.#Subpag|
|00003a60| 65 20 42 75 62 62 6c 65 | 53 6f 72 74 0a 42 75 62 |e Bubble|Sort.Bub|
|00003a70| 62 6c 65 20 53 6f 72 74 | 0a 41 20 62 75 62 62 6c |ble Sort|.A bubbl|
|00003a80| 65 20 73 6f 72 74 20 63 | 6f 6e 73 69 73 74 73 20 |e sort c|onsists |
|00003a90| 6f 66 20 72 65 70 65 61 | 74 65 64 20 70 61 73 73 |of repea|ted pass|
|00003aa0| 65 73 20 74 68 6f 75 67 | 68 20 74 68 65 20 64 61 |es thoug|h the da|
|00003ab0| 74 61 2c 20 63 6f 6d 70 | 61 72 69 6e 67 20 61 64 |ta, comp|aring ad|
|00003ac0| 6a 61 63 65 6e 74 20 6d | 65 6d 62 65 72 73 20 61 |jacent m|embers a|
|00003ad0| 6e 64 20 73 77 61 70 70 | 69 6e 67 20 74 68 65 6d |nd swapp|ing them|
|00003ae0| 20 69 66 20 6e 65 63 65 | 73 73 61 72 79 2e 20 49 | if nece|ssary. I|
|00003af0| 74 20 74 65 72 6d 69 6e | 61 74 65 73 20 77 68 65 |t termin|ates whe|
|00003b00| 6e 20 61 20 70 61 73 73 | 20 69 73 20 6d 61 64 65 |n a pass| is made|
|00003b10| 20 77 69 74 68 20 6e 6f | 20 73 77 61 70 73 2e 0a | with no| swaps..|
|00003b20| 0a 53 61 6d 70 6c 65 20 | 43 6f 64 65 3a 0a 23 66 |.Sample |Code:.#f|
|00003b30| 43 6f 64 65 0a 0a 76 6f | 69 64 20 42 75 62 62 6c |Code..vo|id Bubbl|
|00003b40| 65 53 6f 72 74 28 69 6e | 74 20 6c 61 73 74 52 65 |eSort(in|t lastRe|
|00003b50| 63 6f 72 64 29 0a 7b 0a | 20 20 20 69 6e 74 20 20 |cord).{.| int |
|00003b60| 20 69 3b 0a 20 20 20 76 | 6f 69 64 2a 20 73 61 76 | i;. v|oid* sav|
|00003b70| 65 44 61 74 61 3b 0a 20 | 20 20 62 6f 6f 6c 20 20 |eData;. | bool |
|00003b80| 73 6f 72 74 65 64 20 3d | 20 46 41 4c 53 45 3b 0a |sorted =| FALSE;.|
|00003b90| 0a 20 20 20 77 68 69 6c | 65 28 21 73 6f 72 74 65 |. whil|e(!sorte|
|00003ba0| 64 29 0a 20 20 20 7b 0a | 20 20 20 20 20 20 73 6f |d). {.| so|
|00003bb0| 72 74 65 64 20 3d 20 54 | 52 55 45 3b 0a 20 20 20 |rted = T|RUE;. |
|00003bc0| 20 20 20 66 6f 72 28 69 | 20 3d 20 30 3b 20 69 20 | for(i| = 0; i |
|00003bd0| 5c 3c 20 6c 61 73 74 52 | 65 63 6f 72 64 3b 20 69 |\< lastR|ecord; i|
|00003be0| 2b 2b 29 0a 20 20 20 20 | 20 20 20 20 20 69 66 28 |++). | if(|
|00003bf0| 64 61 74 61 5b 69 20 2b | 20 31 5d 20 5c 3c 20 64 |data[i +| 1] \< d|
|00003c00| 61 74 61 5b 69 5d 29 0a | 20 20 20 20 20 20 20 20 |ata[i]).| |
|00003c10| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | {. | s|
|00003c20| 6f 72 74 65 64 20 3d 20 | 46 41 4c 53 45 3b 0a 20 |orted = |FALSE;. |
|00003c30| 20 20 20 20 20 20 20 20 | 20 20 20 73 61 76 65 44 | | saveD|
|00003c40| 61 74 61 20 3d 20 64 61 | 74 61 5b 69 5d 3b 0a 20 |ata = da|ta[i];. |
|00003c50| 20 20 20 20 20 20 20 20 | 20 20 20 64 61 74 61 5b | | data[|
|00003c60| 69 5d 20 3d 20 64 61 74 | 61 5b 69 20 2b 20 31 5d |i] = dat|a[i + 1]|
|00003c70| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 64 61 |;. | da|
|00003c80| 74 61 5b 69 20 2b 20 31 | 5d 20 3d 20 73 61 76 65 |ta[i + 1|] = save|
|00003c90| 44 61 74 61 3b 0a 20 20 | 20 20 20 20 20 20 20 7d |Data;. | }|
|00003ca0| 0a 20 20 20 20 7d 0a 7d | 0a 23 66 53 74 64 0a 23 |. }.}|.#fStd.#|
|00003cb0| 53 75 62 70 61 67 65 20 | 51 75 69 63 6b 53 6f 72 |Subpage |QuickSor|
|00003cc0| 74 0a 51 75 69 63 6b 20 | 53 6f 72 74 0a 41 20 71 |t.Quick |Sort.A q|
|00003cd0| 75 69 63 6b 20 73 6f 72 | 74 20 77 6f 72 6b 73 20 |uick sor|t works |
|00003ce0| 62 79 20 72 65 63 75 72 | 73 69 76 65 6c 79 20 73 |by recur|sively s|
|00003cf0| 70 6c 69 74 74 69 6e 67 | 20 74 68 65 20 64 61 74 |plitting| the dat|
|00003d00| 61 20 75 70 20 69 6e 74 | 6f 20 74 77 6f 20 73 65 |a up int|o two se|
|00003d10| 74 73 2c 20 73 75 63 68 | 20 74 68 61 74 0a 61 6c |ts, such| that.al|
|00003d20| 6c 20 74 68 65 20 65 6c | 65 6d 65 6e 74 73 20 69 |l the el|ements i|
|00003d30| 6e 20 6f 6e 65 20 73 65 | 74 20 61 72 65 20 62 69 |n one se|t are bi|
|00003d40| 67 67 65 72 20 74 68 61 | 6e 20 61 6c 6c 20 74 68 |gger tha|n all th|
|00003d50| 65 20 65 6c 65 6d 65 6e | 74 73 20 69 6e 20 74 68 |e elemen|ts in th|
|00003d60| 65 20 6f 74 68 65 72 2e | 20 4f 6e 63 65 0a 74 68 |e other.| Once.th|
|00003d70| 65 20 73 65 74 20 73 69 | 7a 65 20 72 65 61 63 68 |e set si|ze reach|
|00003d80| 65 73 20 6f 6e 65 2c 20 | 74 68 65 20 6f 72 69 67 |es one, |the orig|
|00003d90| 69 6e 61 6c 20 73 65 74 | 20 69 73 20 73 6f 72 74 |inal set| is sort|
|00003da0| 65 64 2e 0a 0a 53 61 6d | 70 6c 65 20 43 6f 64 65 |ed...Sam|ple Code|
|00003db0| 3a 0a 23 66 43 6f 64 65 | 0a 0a 76 6f 69 64 20 51 |:.#fCode|..void Q|
|00003dc0| 75 69 63 6b 53 6f 72 74 | 28 69 6e 74 20 73 74 61 |uickSort|(int sta|
|00003dd0| 72 74 2c 20 69 6e 74 20 | 66 69 6e 69 73 68 29 0a |rt, int |finish).|
|00003de0| 5c 7b 0a 20 20 20 69 6e | 74 20 70 61 72 74 69 74 |\{. in|t partit|
|00003df0| 69 6f 6e 3b 0a 0a 20 20 | 20 69 66 28 73 74 61 72 |ion;.. | if(star|
|00003e00| 74 20 5c 3c 20 66 69 6e | 69 73 68 29 0a 20 20 20 |t \< fin|ish). |
|00003e10| 5c 7b 0a 20 20 20 20 20 | 20 70 61 72 74 69 74 69 |\{. | partiti|
|00003e20| 6f 6e 20 3d 20 50 61 72 | 74 69 74 69 6f 6e 28 73 |on = Par|tition(s|
|00003e30| 74 61 72 74 2c 20 66 69 | 6e 69 73 68 29 3b 0a 20 |tart, fi|nish);. |
|00003e40| 20 20 20 20 20 51 75 69 | 63 6b 53 6f 72 74 28 73 | Qui|ckSort(s|
|00003e50| 74 61 72 74 2c 20 70 61 | 72 74 69 74 69 6f 6e 20 |tart, pa|rtition |
|00003e60| 2d 20 31 29 3b 0a 20 20 | 20 20 20 20 51 75 69 63 |- 1);. | Quic|
|00003e70| 6b 53 6f 72 74 28 70 61 | 72 74 69 74 69 6f 6e 20 |kSort(pa|rtition |
|00003e80| 2b 20 31 2c 20 66 69 6e | 69 73 68 29 3b 0a 20 20 |+ 1, fin|ish);. |
|00003e90| 20 7d 0a 7d 0a 0a 69 6e | 74 20 50 61 72 74 69 74 | }.}..in|t Partit|
|00003ea0| 69 6f 6e 28 69 6e 74 20 | 6c 6f 77 65 72 2c 20 69 |ion(int |lower, i|
|00003eb0| 6e 74 20 75 70 70 65 72 | 29 0a 5c 7b 0a 20 20 20 |nt upper|).\{. |
|00003ec0| 54 20 73 61 76 65 44 61 | 74 61 20 3d 20 64 61 74 |T saveDa|ta = dat|
|00003ed0| 61 5b 6c 6f 77 65 72 5d | 3b 0a 20 20 20 77 68 69 |a[lower]|;. whi|
|00003ee0| 6c 65 28 75 70 70 65 72 | 20 21 3d 20 6c 6f 77 65 |le(upper| != lowe|
|00003ef0| 72 29 0a 20 20 20 5c 7b | 0a 20 20 20 20 20 20 77 |r). \{|. w|
|00003f00| 68 69 6c 65 28 75 70 70 | 65 72 20 3e 20 6c 6f 77 |hile(upp|er > low|
|00003f10| 65 72 20 26 26 20 73 61 | 76 65 44 61 74 61 20 3e |er && sa|veData >|
|00003f20| 3d 20 64 61 74 61 5b 75 | 70 70 65 72 5d 29 0a 20 |= data[u|pper]). |
|00003f30| 20 20 20 20 20 20 20 20 | 75 70 70 65 72 2d 2d 3b | |upper--;|
|00003f40| 0a 20 20 20 20 20 20 69 | 66 28 75 70 70 65 72 20 |. i|f(upper |
|00003f50| 21 3d 20 6c 6f 77 65 72 | 29 0a 20 20 20 20 20 20 |!= lower|). |
|00003f60| 20 20 20 64 61 74 61 5b | 6c 6f 77 65 72 5d 20 3d | data[|lower] =|
|00003f70| 20 64 61 74 61 5b 75 70 | 70 65 72 5d 3b 0a 20 20 | data[up|per];. |
|00003f80| 20 20 20 20 77 68 69 6c | 65 28 75 70 70 65 72 20 | whil|e(upper |
|00003f90| 3e 20 6c 6f 77 65 72 20 | 26 26 20 73 61 76 65 44 |> lower |&& saveD|
|00003fa0| 61 74 61 20 3c 3d 20 64 | 61 74 61 5b 6c 6f 77 65 |ata <= d|ata[lowe|
|00003fb0| 72 5d 29 0a 20 20 20 20 | 20 20 20 20 20 6c 6f 77 |r]). | low|
|00003fc0| 65 72 2b 2b 3b 0a 20 20 | 20 20 20 20 69 66 28 75 |er++;. | if(u|
|00003fd0| 70 70 65 72 20 21 3d 20 | 6c 6f 77 65 72 29 0a 20 |pper != |lower). |
|00003fe0| 20 20 20 20 20 20 20 20 | 64 61 74 61 5b 75 70 70 | |data[upp|
|00003ff0| 65 72 5d 20 3d 20 64 61 | 74 61 5b 6c 6f 77 65 72 |er] = da|ta[lower|
|00004000| 5d 3b 0a 20 20 20 7d 0a | 20 20 20 64 61 74 61 5b |];. }.| data[|
|00004010| 6c 6f 77 65 72 5d 20 3d | 20 73 61 76 65 44 61 74 |lower] =| saveDat|
|00004020| 61 3b 0a 0a 20 20 20 72 | 65 74 75 72 6e 20 6c 6f |a;.. r|eturn lo|
|00004030| 77 65 72 3b 0a 7d 0a 0a | 23 66 53 74 64 0a 00 00 |wer;.}..|#fStd...|
|00004040| 44 41 54 41 33 00 00 00 | 53 65 74 73 0a 43 6f 6c |DATA3...|Sets.Col|
|00004050| 6c 65 63 74 69 6f 6e 20 | 6f 66 20 28 75 6e 64 75 |lection |of (undu|
|00004060| 70 6c 69 63 61 74 65 64 | 29 20 69 74 65 6d 73 2e |plicated|) items.|
|00004070| 0a 0a 0a 00 44 41 54 41 | e5 01 00 00 54 79 70 65 |....DATA|....Type|
|00004080| 73 20 73 69 7a 65 73 0a | 49 6e 20 43 2b 2b 2c 20 |s sizes.|In C++, |
|00004090| 61 6c 6c 20 74 68 61 74 | 20 69 73 20 67 75 61 72 |all that| is guar|
|000040a0| 61 6e 74 65 65 64 20 61 | 62 6f 75 74 20 74 79 70 |anteed a|bout typ|
|000040b0| 65 20 73 69 7a 65 73 20 | 69 73 20 74 68 65 20 66 |e sizes |is the f|
|000040c0| 6f 6c 6c 6f 77 69 6e 67 | 3a 0a 0a 31 20 3d 20 73 |ollowing|:..1 = s|
|000040d0| 69 7a 65 6f 66 28 63 68 | 61 72 29 20 3c 3d 20 73 |izeof(ch|ar) <= s|
|000040e0| 69 7a 65 6f 66 28 73 68 | 6f 72 74 29 20 3c 3d 20 |izeof(sh|ort) <= |
|000040f0| 73 69 7a 65 6f 66 28 69 | 6e 74 29 20 3c 3d 20 73 |sizeof(i|nt) <= s|
|00004100| 69 7a 65 6f 66 28 6c 6f | 6e 67 29 0a 0a 73 69 7a |izeof(lo|ng)..siz|
|00004110| 65 6f 66 28 66 6c 6f 61 | 74 29 20 3c 3d 20 73 69 |eof(floa|t) <= si|
|00004120| 7a 65 6f 66 28 64 6f 75 | 62 6c 65 29 20 3c 3d 20 |zeof(dou|ble) <= |
|00004130| 73 69 7a 65 6f 66 28 6c | 6f 6e 67 20 64 6f 75 62 |sizeof(l|ong doub|
|00004140| 6c 65 29 0a 0a 73 69 7a | 65 6f 66 28 54 29 20 3d |le)..siz|eof(T) =|
|00004150| 20 73 69 7a 65 6f 66 28 | 73 69 67 6e 65 64 20 54 | sizeof(|signed T|
|00004160| 29 20 3d 20 73 69 7a 65 | 6f 66 28 75 6e 73 69 67 |) = size|of(unsig|
|00004170| 6e 65 64 20 54 29 0a 0a | 77 68 65 72 65 20 54 20 |ned T)..|where T |
|00004180| 6d 61 79 20 62 65 20 61 | 20 63 68 61 72 2c 20 73 |may be a| char, s|
|00004190| 68 6f 72 74 2c 20 69 6e | 74 2c 20 6f 72 20 6c 6f |hort, in|t, or lo|
|000041a0| 6e 67 2e 0a 0a 46 75 72 | 74 68 65 72 6d 6f 72 65 |ng...Fur|thermore|
|000041b0| 2c 20 69 74 20 69 73 20 | 67 75 61 72 61 6e 74 65 |, it is |guarante|
|000041c0| 65 64 20 74 68 61 74 3a | 0a 0a 73 69 7a 65 6f 66 |ed that:|..sizeof|
|000041d0| 28 63 68 61 72 29 20 3e | 3d 20 38 20 62 69 74 73 |(char) >|= 8 bits|
|000041e0| 0a 73 69 7a 65 6f 66 28 | 73 68 6f 72 74 29 20 3e |.sizeof(|short) >|
|000041f0| 3d 20 31 36 20 62 69 74 | 73 0a 73 69 7a 65 6f 66 |= 16 bit|s.sizeof|
|00004200| 28 6c 6f 6e 67 29 20 3e | 3d 20 33 32 20 62 69 74 |(long) >|= 32 bit|
|00004210| 73 0a 0a 61 6e 64 20 61 | 20 63 68 61 72 20 63 61 |s..and a| char ca|
|00004220| 6e 20 61 6c 77 61 79 73 | 20 68 6f 6c 64 20 61 20 |n always| hold a |
|00004230| 63 68 61 72 61 63 74 65 | 72 20 6f 66 20 74 68 65 |characte|r of the|
|00004240| 20 6d 61 63 68 69 6e 65 | 73 20 63 68 61 72 61 63 | machine|s charac|
|00004250| 74 65 72 20 73 65 74 2e | 0a 00 00 00 44 41 54 41 |ter set.|....DATA|
|00004260| 6c 03 00 00 53 6d 61 72 | 74 20 50 6f 69 6e 74 65 |l...Smar|t Pointe|
|00004270| 72 73 0a 41 20 73 6d 61 | 72 74 20 70 6f 69 6e 74 |rs.A sma|rt point|
|00004280| 65 72 20 69 73 20 61 6e | 20 6f 62 6a 65 63 74 20 |er is an| object |
|00004290| 77 68 69 63 68 20 6d 69 | 6d 69 63 73 20 61 20 70 |which mi|mics a p|
|000042a0| 6f 69 6e 74 65 72 2c 20 | 61 6e 64 20 70 65 72 66 |ointer, |and perf|
|000042b0| 6f 72 6d 73 20 73 6f 6d | 65 0a 6f 74 68 65 72 20 |orms som|e.other |
|000042c0| 66 75 6e 63 74 69 6f 6e | 20 77 68 65 6e 65 76 65 |function| wheneve|
|000042d0| 72 20 61 6e 20 6f 62 6a | 65 63 74 20 69 73 20 72 |r an obj|ect is r|
|000042e0| 65 66 65 72 65 6e 63 65 | 64 20 74 68 72 6f 75 67 |eference|d throug|
|000042f0| 68 20 74 68 65 6d 2e 0a | 0a 45 78 61 6d 70 6c 65 |h them..|.Example|
|00004300| 3a 0a 0a 23 54 61 62 0a | 63 6c 61 73 73 20 50 46 |:..#Tab.|class PF|
|00004310| 6f 6f 20 5c 7b 0a 09 46 | 6f 6f 2a 5c 74 61 5f 70 |oo \{..F|oo*\ta_p|
|00004320| 74 72 3b 0a 09 63 6f 6e | 73 74 20 63 68 61 72 5c |tr;..con|st char\|
|00004330| 2a 5c 74 61 5f 66 69 6c | 65 4e 61 6d 65 3b 0a 70 |*\ta_fil|eName;.p|
|00004340| 75 62 6c 69 63 3a 0a 20 | 20 20 20 20 20 20 20 20 |ublic:. | |
|00004350| 20 20 20 20 20 20 20 20 | 20 20 20 50 46 6f 6f 28 | | PFoo(|
|00004360| 63 6f 6e 73 74 20 63 68 | 61 72 2a 29 3b 0a 09 46 |const ch|ar*);..F|
|00004370| 6f 6f 2a 20 09 09 09 6f | 70 65 72 61 74 6f 72 2d |oo* ...o|perator-|
|00004380| 3e 28 29 3b 0a 7d 3b 0a | 0a 50 46 6f 6f 3a 3a 50 |>();.};.|.PFoo::P|
|00004390| 46 6f 6f 28 63 68 61 72 | 2a 20 70 5f 66 69 6c 65 |Foo(char|* p_file|
|000043a0| 4e 61 6d 65 29 0a 09 3a | 09 61 5f 66 69 6c 65 4e |Name)..:|.a_fileN|
|000043b0| 61 6d 65 28 70 5f 66 69 | 6c 65 4e 61 6d 65 29 0a |ame(p_fi|leName).|
|000043c0| 7b 0a 09 61 5f 70 74 72 | 20 3d 20 30 3b 20 2f 2f |{..a_ptr| = 0; //|
|000043d0| 6e 6f 74 20 79 65 74 20 | 6c 6f 61 64 65 64 0a 7d |not yet |loaded.}|
|000043e0| 0a 0a 50 46 6f 6f 3a 3a | 7e 50 46 6f 6f 28 76 6f |..PFoo::|~PFoo(vo|
|000043f0| 69 64 29 0a 7b 0a 09 77 | 72 69 74 65 5f 74 6f 5f |id).{..w|rite_to_|
|00004400| 64 69 73 63 28 70 5f 66 | 69 6c 65 4e 61 6d 65 29 |disc(p_f|ileName)|
|00004410| 3b 0a 7d 0a 0a 46 6f 6f | 2a 20 50 46 6f 6f 3a 3a |;.}..Foo|* PFoo::|
|00004420| 6f 70 65 72 61 74 6f 72 | 2d 3e 28 76 6f 69 64 29 |operator|->(void)|
|00004430| 0a 7b 0a 09 69 66 28 61 | 5f 70 74 72 20 3d 3d 20 |.{..if(a|_ptr == |
|00004440| 30 29 20 61 5f 70 74 72 | 20 3d 20 72 65 61 64 5f |0) a_ptr| = read_|
|00004450| 66 72 6f 6d 5f 64 69 73 | 63 28 61 5f 66 69 6c 65 |from_dis|c(a_file|
|00004460| 4e 61 6d 65 29 3b 0a 09 | 72 65 74 75 72 6e 20 61 |Name);..|return a|
|00004470| 5f 70 74 72 3b 0a 7d 0a | 0a 41 6e 6f 74 68 65 72 |_ptr;.}.|.Another|
|00004480| 20 75 73 65 20 6f 66 20 | 61 20 73 6d 61 72 74 20 | use of |a smart |
|00004490| 70 6f 69 6e 74 65 72 20 | 69 73 20 74 6f 20 63 68 |pointer |is to ch|
|000044a0| 65 63 6b 20 74 68 61 74 | 20 69 74 20 64 6f 65 73 |eck that| it does|
|000044b0| 20 69 6e 20 66 61 63 74 | 20 70 6f 69 6e 74 20 74 | in fact| point t|
|000044c0| 6f 20 61 0a 76 61 6c 69 | 64 20 6f 62 6a 65 63 74 |o a.vali|d object|
|000044d0| 2c 20 62 79 20 63 68 65 | 63 6b 69 6e 67 20 77 68 |, by che|cking wh|
|000044e0| 65 6e 20 69 74 20 69 73 | 20 63 68 61 6e 67 65 64 |en it is| changed|
|000044f0| 2e 20 50 6f 73 74 66 69 | 78 20 61 6e 64 20 70 72 |. Postfi|x and pr|
|00004500| 65 66 69 78 20 76 65 72 | 73 69 6f 6e 73 0a 6f 66 |efix ver|sions.of|
|00004510| 20 74 68 65 20 69 6e 63 | 72 65 6d 65 6e 74 20 61 | the inc|rement a|
|00004520| 6e 64 20 64 65 63 72 65 | 6d 65 6e 74 20 6f 70 65 |nd decre|ment ope|
|00004530| 72 61 74 6f 72 73 2c 61 | 6e 64 20 74 68 65 20 61 |rators,a|nd the a|
|00004540| 73 73 69 67 6e 6d 65 6e | 74 20 6f 70 65 72 61 74 |ssignmen|t operat|
|00004550| 6f 72 20 6e 65 65 64 0a | 74 6f 20 62 65 20 64 65 |or need.|to be de|
|00004560| 66 69 6e 65 64 20 28 73 | 6f 20 74 68 61 74 20 61 |fined (s|o that a|
|00004570| 5f 70 74 72 20 69 73 20 | 6d 6f 64 69 66 69 65 64 |_ptr is |modified|
|00004580| 20 61 70 70 72 6f 70 72 | 69 61 74 65 6c 79 29 2e | appropr|iately).|
|00004590| 0a 23 4c 69 6e 65 0a 43 | 6f 64 65 20 66 72 61 67 |.#Line.C|ode frag|
|000045a0| 6d 65 6e 74 20 6d 6f 64 | 69 66 69 65 64 20 66 72 |ment mod|ified fr|
|000045b0| 6f 6d 20 53 74 72 6f 75 | 73 74 72 75 70 20 73 65 |om Strou|strup se|
|000045c0| 63 20 37 2e 39 0a 0a 0a | 44 41 54 41 51 03 00 00 |c 7.9...|DATAQ...|
|000045d0| 53 74 61 63 6b 73 0a 53 | 65 71 75 65 6e 63 65 20 |Stacks.S|equence |
|000045e0| 6f 66 20 69 74 65 6d 20 | 69 6e 20 77 68 69 63 68 |of item |in which|
|000045f0| 20 69 74 65 6d 73 20 6d | 61 79 20 62 65 20 61 64 | items m|ay be ad|
|00004600| 64 65 64 20 61 6e 64 20 | 72 65 6d 6f 76 65 64 20 |ded and |removed |
|00004610| 66 72 6f 6d 20 74 68 65 | 20 73 61 6d 65 20 65 6e |from the| same en|
|00004620| 64 2e 20 49 74 20 69 6d | 70 6c 65 6d 65 6e 74 73 |d. It im|plements|
|00004630| 20 74 68 65 20 63 68 61 | 72 61 63 74 65 72 69 73 | the cha|racteris|
|00004640| 74 69 63 20 4c 49 46 4f | 20 28 6c 61 73 74 20 69 |tic LIFO| (last i|
|00004650| 6e 20 66 69 72 73 74 20 | 6f 75 74 29 2e 0a 0a 23 |n first |out)...#|
|00004660| 66 48 34 3a 49 6d 70 6c | 65 6d 65 6e 74 61 74 69 |fH4:Impl|ementati|
|00004670| 6f 6e 20 61 73 20 61 6e | 20 61 72 72 61 79 0a 55 |on as an| array.U|
|00004680| 73 65 20 74 68 69 73 20 | 69 6d 70 6c 65 6d 65 6e |se this |implemen|
|00004690| 74 61 74 69 6f 6e 20 77 | 68 65 6e 20 74 68 65 20 |tation w|hen the |
|000046a0| 73 74 61 63 6b 20 73 69 | 7a 65 20 69 73 20 6b 6e |stack si|ze is kn|
|000046b0| 6f 77 6e 20 69 6e 20 61 | 64 76 61 6e 63 65 2c 20 |own in a|dvance, |
|000046c0| 6f 72 20 69 66 20 73 70 | 65 65 64 20 69 73 20 6e |or if sp|eed is n|
|000046d0| 6f 74 20 61 6e 20 69 73 | 73 75 65 2e 20 49 74 20 |ot an is|sue. It |
|000046e0| 63 61 6e 20 67 72 6f 77 | 20 64 79 6e 61 6d 69 63 |can grow| dynamic|
|000046f0| 61 6c 6c 79 20 69 66 20 | 72 65 71 75 69 72 65 64 |ally if |required|
|00004700| 2c 20 62 75 74 20 65 61 | 63 68 20 64 79 6e 61 6d |, but ea|ch dynam|
|00004710| 69 63 20 67 72 6f 77 74 | 68 20 6f 72 20 73 68 72 |ic growt|h or shr|
|00004720| 69 6e 6b 20 77 69 6c 6c | 20 74 61 6b 65 20 61 20 |ink will| take a |
|00004730| 63 6f 6e 73 69 64 65 72 | 61 62 6c 65 20 61 6d 6f |consider|able amo|
|00004740| 75 6e 74 20 6f 66 20 74 | 69 6d 65 2e 0a 0a 44 61 |unt of t|ime...Da|
|00004750| 74 61 3a 0a 09 61 72 72 | 61 79 20 6f 66 20 70 6f |ta:..arr|ay of po|
|00004760| 69 6e 74 65 72 73 20 74 | 6f 20 64 61 74 61 0a 09 |inters t|o data..|
|00004770| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 6f 70 20 6f |pointer |to top o|
|00004780| 66 20 64 61 74 61 0a 09 | 73 69 7a 65 20 6f 66 20 |f data..|size of |
|00004790| 61 72 72 61 79 0a 0a 4d | 65 6d 6f 72 79 20 4f 76 |array..M|emory Ov|
|000047a0| 65 72 68 65 61 64 3a 20 | 38 20 62 79 74 65 73 0a |erhead: |8 bytes.|
|000047b0| 0a 23 66 48 34 3a 49 6d | 70 6c 65 6d 65 6e 74 61 |.#fH4:Im|plementa|
|000047c0| 74 69 6f 6e 20 61 73 20 | 61 20 6c 69 73 74 20 28 |tion as |a list (|
|000047d0| 73 69 6e 67 6c 79 20 6c | 69 6e 6b 65 64 29 2e 0a |singly l|inked)..|
|000047e0| 55 73 65 20 74 68 69 73 | 20 69 6d 70 6c 65 6d 65 |Use this| impleme|
|000047f0| 6e 74 61 74 69 6f 6e 20 | 77 68 65 6e 20 74 68 65 |ntation |when the|
|00004800| 20 73 69 7a 65 20 6f 66 | 20 74 68 65 20 73 74 61 | size of| the sta|
|00004810| 63 6b 20 77 69 6c 6c 20 | 63 68 61 6e 67 65 20 66 |ck will |change f|
|00004820| 72 65 71 75 65 6e 74 6c | 79 2e 0a 0a 44 61 74 61 |requentl|y...Data|
|00004830| 3a 0a 09 69 6e 64 69 76 | 69 64 75 61 6c 20 6c 69 |:..indiv|idual li|
|00004840| 73 74 20 6e 6f 64 65 73 | 20 63 6f 6e 73 69 73 74 |st nodes| consist|
|00004850| 69 6e 67 20 6f 66 3a 0a | 09 09 70 6f 69 6e 74 65 |ing of:.|..pointe|
|00004860| 72 20 74 6f 20 64 61 74 | 61 0a 09 09 70 6f 69 6e |r to dat|a...poin|
|00004870| 74 65 72 20 74 6f 20 6e | 6f 64 65 20 69 6d 6d 65 |ter to n|ode imme|
|00004880| 64 69 61 74 65 6c 79 20 | 62 65 6c 6f 77 20 69 6e |diately |below in|
|00004890| 20 73 74 61 63 6b 0a 0a | 09 70 6f 69 6e 74 65 72 | stack..|.pointer|
|000048a0| 20 74 6f 20 74 6f 70 20 | 6c 69 73 74 20 6e 6f 64 | to top |list nod|
|000048b0| 65 20 69 6e 20 73 74 61 | 63 6b 20 28 6f 70 74 69 |e in sta|ck (opti|
|000048c0| 6f 6e 61 6c 2c 20 62 75 | 74 20 68 69 67 68 6c 79 |onal, bu|t highly|
|000048d0| 20 72 65 63 6f 6d 6d 65 | 6e 64 65 64 20 66 6f 72 | recomme|nded for|
|000048e0| 20 73 70 65 65 64 29 0a | 0a 4d 65 6d 6f 72 79 20 | speed).|.Memory |
|000048f0| 6f 76 65 72 68 65 61 64 | 3a 20 34 20 62 79 74 65 |overhead|: 4 byte|
|00004900| 73 20 70 6c 75 73 20 34 | 20 62 79 74 65 73 20 70 |s plus 4| bytes p|
|00004910| 65 72 20 69 74 65 6d 2e | 0a 00 00 00 44 41 54 41 |er item.|....DATA|
|00004920| 66 01 00 00 48 65 6c 70 | 20 6f 6e 20 53 74 61 6e |f...Help| on Stan|
|00004930| 64 61 72 64 20 43 2b 2b | 20 4c 69 62 72 61 72 79 |dard C++| Library|
|00004940| 0a 23 54 61 62 6c 65 20 | 4c 69 6e 65 73 20 20 34 |.#Table |Lines 4|
|00004950| 0a 63 6f 6d 6d 6f 6e 2e | 68 0a 3c 63 6f 6d 70 6c |.common.|h.<compl|
|00004960| 65 78 2e 68 3d 3e 63 6f | 6d 70 6c 65 78 3e 0a 3c |ex.h=>co|mplex>.<|
|00004970| 66 6c 6f 61 74 2e 68 3d | 3e 43 3a 66 6c 6f 61 74 |float.h=|>C:float|
|00004980| 3e 0a 3c 66 73 74 72 65 | 61 6d 2e 68 3d 3e 66 73 |>.<fstre|am.h=>fs|
|00004990| 74 72 65 61 6d 3e 0a 67 | 65 6e 65 72 69 63 2e 68 |tream>.g|eneric.h|
|000049a0| 0a 3c 69 6f 6d 61 6e 69 | 70 2e 68 3d 3e 69 6f 6d |.<iomani|p.h=>iom|
|000049b0| 61 6e 69 70 3e 0a 3c 69 | 6f 73 74 72 65 61 6d 2e |anip>.<i|ostream.|
|000049c0| 68 3d 3e 69 6f 73 74 72 | 65 61 6d 3e 0a 3c 6c 69 |h=>iostr|eam>.<li|
|000049d0| 62 63 2e 68 3d 3e 43 3a | 73 74 64 6c 69 62 3e 0a |bc.h=>C:|stdlib>.|
|000049e0| 3c 6d 61 6c 6c 6f 63 2e | 68 3d 3e 6d 61 6c 6c 6f |<malloc.|h=>mallo|
|000049f0| 63 3e 0a 3c 6d 65 6d 6f | 72 79 2e 68 3d 3e 6d 65 |c>.<memo|ry.h=>me|
|00004a00| 6d 6f 72 79 3e 0a 6e 65 | 77 2e 68 0a 3c 6f 73 66 |mory>.ne|w.h.<osf|
|00004a10| 63 6e 2e 68 3d 3e 6f 73 | 63 66 6e 3e 0a 3c 73 74 |cn.h=>os|cfn>.<st|
|00004a20| 64 69 6f 73 74 72 65 61 | 2e 68 3d 3e 73 74 64 69 |diostrea|.h=>stdi|
|00004a30| 6f 73 74 72 65 61 6d 3e | 0a 3c 73 74 72 65 61 6d |ostream>|.<stream|
|00004a40| 2e 68 3d 3e 73 74 72 65 | 61 6d 3e 0a 3c 73 74 72 |.h=>stre|am>.<str|
|00004a50| 73 74 72 65 61 6d 2e 68 | 3d 3e 73 74 72 73 74 72 |stream.h|=>strstr|
|00004a60| 65 61 6d 3e 0a 3c 76 61 | 6c 75 65 73 2e 68 3d 3e |eam>.<va|lues.h=>|
|00004a70| 76 61 6c 75 65 73 3e 0a | 23 45 6e 64 74 61 62 6c |values>.|#Endtabl|
|00004a80| 65 0a 00 00 44 41 54 41 | d6 01 00 00 53 74 61 6e |e...DATA|....Stan|
|00004a90| 64 61 72 64 20 54 65 6d | 70 6c 61 74 65 20 4c 69 |dard Tem|plate Li|
|00004aa0| 62 72 61 72 79 0a 49 20 | 61 6d 20 63 75 72 72 65 |brary.I |am curre|
|00004ab0| 6e 74 6c 79 20 74 72 79 | 69 6e 67 20 74 6f 20 67 |ntly try|ing to g|
|00004ac0| 65 74 20 74 68 69 73 20 | 74 6f 20 77 6f 72 6b 2e |et this |to work.|
|00004ad0| 20 53 6f 20 66 61 72 0a | 74 68 65 20 66 6f 6c 6c | So far.|the foll|
|00004ae0| 6f 77 69 6e 67 20 66 69 | 6c 65 73 20 63 6f 6d 70 |owing fi|les comp|
|00004af0| 69 6c 65 20 75 6e 64 65 | 72 20 41 63 6f 72 6e 20 |ile unde|r Acorn |
|00004b00| 43 2f 43 2b 2b 0a 0a 23 | 54 61 62 6c 65 20 6c 69 |C/C++..#|Table li|
|00004b10| 6e 65 73 20 34 0a 62 6f | 6f 6c 2e 68 0a 70 61 69 |nes 4.bo|ol.h.pai|
|00004b20| 72 2e 68 0a 68 65 61 70 | 2e 68 0a 74 65 6d 70 62 |r.h.heap|.h.tempb|
|00004b30| 75 66 2e 68 0a 23 45 6e | 64 74 61 62 6c 65 0a 0a |uf.h.#En|dtable..|
|00004b40| 49 20 67 75 65 73 73 20 | 68 65 61 70 73 20 6d 69 |I guess |heaps mi|
|00004b50| 67 68 74 20 62 65 20 6f | 66 20 73 6f 6d 65 20 75 |ght be o|f some u|
|00004b60| 73 65 2e 20 47 43 43 20 | 32 2e 34 2e 35 20 63 6f |se. GCC |2.4.5 co|
|00004b70| 6d 65 73 0a 6f 75 74 20 | 61 20 6c 6f 74 20 62 65 |mes.out |a lot be|
|00004b80| 74 74 65 72 2e 20 49 74 | 20 63 6f 6d 70 69 6c 65 |tter. It| compile|
|00004b90| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |s the fo|llowing |
|00004ba0| 66 69 6c 65 73 0a 7b 2a | 7d 61 73 20 77 65 6c 6c |files.{*|}as well|
|00004bb0| 7b 2a 7d 0a 0a 23 54 61 | 62 6c 65 20 6c 69 6e 65 |{*}..#Ta|ble line|
|00004bc0| 73 20 34 0a 70 72 6f 6a | 65 63 74 6e 2e 68 0a 66 |s 4.proj|ectn.h.f|
|00004bd0| 75 6e 63 74 69 6f 6e 2e | 68 0a 73 74 61 63 6b 2e |unction.|h.stack.|
|00004be0| 68 0a 61 6c 67 6f 62 61 | 73 65 2e 68 0a 69 74 65 |h.algoba|se.h.ite|
|00004bf0| 72 61 74 6f 72 2e 68 20 | 2d 20 77 69 74 68 20 6d |rator.h |- with m|
|00004c00| 69 6e 6f 72 20 66 69 78 | 0a 23 45 6e 64 74 61 62 |inor fix|.#Endtab|
|00004c10| 6c 65 0a 0a 49 20 74 68 | 69 6e 6b 20 61 6c 67 6f |le..I th|ink algo|
|00004c20| 2e 68 20 63 61 6e 20 62 | 65 20 66 69 78 65 64 20 |.h can b|e fixed |
|00004c30| 65 61 73 69 6c 79 2e 20 | 54 68 65 20 6f 74 68 65 |easily. |The othe|
|00004c40| 72 73 20 77 69 6c 6c 0a | 72 65 71 75 69 72 65 20 |rs will.|require |
|00004c50| 6d 6f 72 65 20 77 6f 72 | 6b 2e 00 00 44 41 54 41 |more wor|k...DATA|
|00004c60| 69 00 00 00 53 74 72 69 | 6e 67 73 0a 49 6e 64 65 |i...Stri|ngs.Inde|
|00004c70| 78 61 62 6c 65 20 73 65 | 71 75 65 6e 63 65 20 6f |xable se|quence o|
|00004c80| 66 20 69 74 65 6d 73 2c | 20 77 69 74 68 20 62 65 |f items,| with be|
|00004c90| 68 61 76 69 6f 75 72 73 | 20 69 6e 76 6f 6c 76 69 |haviours| involvi|
|00004ca0| 6e 67 20 74 68 65 20 6d | 61 6e 69 70 75 6c 61 74 |ng the m|anipulat|
|00004cb0| 69 6f 6e 20 6f 66 20 73 | 75 62 73 74 72 69 6e 67 |ion of s|ubstring|
|00004cc0| 73 2e 0a 0a 0a 00 00 00 | 44 41 54 41 1f 02 00 00 |s.......|DATA....|
|00004cd0| 61 75 74 6f 2c 20 72 65 | 67 69 73 74 65 72 0a 54 |auto, re|gister.T|
|00004ce0| 68 65 73 65 20 6b 65 79 | 77 6f 72 64 73 20 61 72 |hese key|words ar|
|00004cf0| 65 20 70 61 72 74 20 6f | 66 20 74 68 65 20 43 2b |e part o|f the C+|
|00004d00| 2b 20 6c 61 6e 67 75 61 | 67 65 2c 20 62 75 74 20 |+ langua|ge, but |
|00004d10| 76 65 72 79 20 72 61 72 | 65 6c 79 20 75 73 65 64 |very rar|ely used|
|00004d20| 2e 20 41 75 74 6f 20 69 | 73 20 67 65 6e 65 72 61 |. Auto i|s genera|
|00004d30| 6c 6c 79 20 72 65 64 75 | 6e 64 61 6e 74 2e 20 49 |lly redu|ndant. I|
|00004d40| 20 2a 74 68 69 6e 6b 2a | 20 61 20 76 61 72 69 61 | *think*| a varia|
|00004d50| 62 6c 65 20 69 73 20 61 | 75 74 6f 6d 61 74 69 63 |ble is a|utomatic|
|00004d60| 61 6c 6c 79 20 3b 29 20 | 61 75 74 6f 2c 20 69 66 |ally ;) |auto, if|
|00004d70| 20 69 74 20 69 73 20 6e | 6f 74 20 72 65 67 69 73 | it is n|ot regis|
|00004d80| 74 65 72 2c 20 73 74 61 | 74 69 63 2c 20 63 6f 6e |ter, sta|tic, con|
|00004d90| 73 74 2c 20 6f 72 20 76 | 6f 6c 61 74 69 6c 65 2e |st, or v|olatile.|
|00004da0| 20 52 65 67 69 73 74 65 | 72 20 69 73 20 64 65 66 | Registe|r is def|
|00004db0| 69 6e 69 74 65 6c 79 20 | 6f 75 74 20 6f 66 20 64 |initely |out of d|
|00004dc0| 61 74 65 20 2d 20 69 74 | 20 69 73 20 61 20 72 65 |ate - it| is a re|
|00004dd0| 71 75 65 73 74 20 74 6f | 20 74 68 65 20 63 6f 6d |quest to| the com|
|00004de0| 70 69 6c 65 72 20 74 68 | 61 74 20 61 20 76 61 72 |piler th|at a var|
|00004df0| 69 61 62 6c 65 20 62 65 | 20 73 74 6f 72 65 64 20 |iable be| stored |
|00004e00| 69 6e 20 61 20 72 65 67 | 69 73 74 65 72 20 72 61 |in a reg|ister ra|
|00004e10| 74 68 65 72 20 74 68 61 | 6e 20 6d 65 6d 6f 72 79 |ther tha|n memory|
|00004e20| 2c 20 6e 6f 72 6d 61 6c | 6c 79 20 66 6f 72 20 70 |, normal|ly for p|
|00004e30| 65 72 66 6f 72 6d 61 6e | 63 65 20 72 65 61 73 6f |erforman|ce reaso|
|00004e40| 6e 73 20 2d 20 65 67 20 | 61 20 6c 6f 6f 70 20 63 |ns - eg |a loop c|
|00004e50| 6f 75 6e 74 65 72 2e 20 | 4d 6f 64 65 72 6e 20 63 |ounter. |Modern c|
|00004e60| 6f 6d 70 69 6c 65 72 73 | 20 75 73 65 20 61 20 76 |ompilers| use a v|
|00004e70| 61 72 69 65 74 79 20 6f | 66 20 74 65 63 68 6e 69 |ariety o|f techni|
|00004e80| 71 75 65 73 20 74 6f 20 | 63 68 6f 6f 73 65 20 77 |ques to |choose w|
|00004e90| 68 69 63 68 20 76 61 72 | 69 61 62 6c 65 73 20 74 |hich var|iables t|
|00004ea0| 6f 20 70 75 74 20 69 6e | 20 72 65 67 69 73 74 65 |o put in| registe|
|00004eb0| 72 73 2c 20 61 6e 64 20 | 67 65 6e 65 72 61 6c 6c |rs, and |generall|
|00004ec0| 79 20 63 61 6e 20 64 6f | 20 69 74 20 72 61 74 68 |y can do| it rath|
|00004ed0| 65 72 20 62 65 74 74 65 | 72 20 74 68 61 6e 20 68 |er bette|r than h|
|00004ee0| 75 6d 61 6e 73 2e 20 00 | 44 49 52 24 9c 00 00 00 |umans. .|DIR$....|
|00004ef0| 9c 00 00 00 84 4f 00 00 | 46 ff ff ff 74 95 7f b3 |.....O..|F...t...|
|00004f00| 41 04 00 00 13 00 00 00 | 00 00 00 00 54 72 65 65 |A.......|....Tree|
|00004f10| 73 00 00 00 c8 53 00 00 | 46 ff ff ff c9 c4 69 ab |s....S..|F.....i.|
|00004f20| b6 06 00 00 13 00 00 00 | 00 00 00 00 56 69 72 74 |........|....Virt|
|00004f30| 75 61 6c 46 75 6e 63 74 | 69 6f 6e 73 00 00 00 00 |ualFunct|ions....|
|00004f40| 80 5a 00 00 46 ff ff ff | c5 ce f0 d2 8e 01 00 00 |.Z..F...|........|
|00004f50| 13 00 00 00 00 00 00 00 | 76 6f 6c 61 74 69 6c 65 |........|volatile|
|00004f60| 00 00 00 00 10 5c 00 00 | 46 ff ff ff 06 38 f1 d2 |.....\..|F....8..|
|00004f70| 70 03 00 00 13 00 00 00 | 00 00 00 00 54 79 70 65 |p.......|....Type|
|00004f80| 73 00 00 00 44 41 54 41 | 41 04 00 00 54 72 65 65 |s...DATA|A...Tree|
|00004f90| 73 0a 52 6f 6f 74 65 64 | 20 63 6f 6c 6c 65 63 74 |s.Rooted| collect|
|00004fa0| 69 6f 6e 20 6f 66 20 6e | 6f 64 65 73 20 61 6e 64 |ion of n|odes and|
|00004fb0| 20 61 72 63 73 2c 20 77 | 68 69 63 68 20 6d 61 79 | arcs, w|hich may|
|00004fc0| 20 6e 6f 74 20 63 6f 6e | 74 61 69 6e 20 63 79 63 | not con|tain cyc|
|00004fd0| 6c 65 73 20 6f 72 20 63 | 72 6f 73 73 2d 72 65 66 |les or c|ross-ref|
|00004fe0| 65 72 65 6e 63 65 73 3b | 20 73 74 72 75 63 74 75 |erences;| structu|
|00004ff0| 72 61 6c 20 73 68 61 72 | 69 6e 67 20 69 73 20 70 |ral shar|ing is p|
|00005000| 65 72 6d 69 74 74 65 64 | 2e 0a 0a 54 72 65 65 73 |ermitted|...Trees|
|00005010| 20 6d 61 79 20 62 65 20 | 62 69 6e 61 72 79 2c 20 | may be |binary, |
|00005020| 6d 75 6c 74 69 77 61 79 | 2c 20 61 6e 64 20 65 73 |multiway|, and es|
|00005030| 70 65 63 69 61 6c 6c 79 | 20 62 61 6c 61 6e 63 65 |pecially| balance|
|00005040| 64 20 62 69 6e 61 72 79 | 20 73 65 61 72 63 68 20 |d binary| search |
|00005050| 74 72 65 65 73 2c 20 61 | 6c 73 6f 20 6b 6e 6f 77 |trees, a|lso know|
|00005060| 6e 20 61 73 20 41 56 4c | 20 74 72 65 65 73 20 28 |n as AVL| trees (|
|00005070| 61 66 74 65 72 20 41 64 | 65 6c 73 6f 6e 2d 56 65 |after Ad|elson-Ve|
|00005080| 6c 73 6b 69 69 20 61 6e | 64 20 4c 61 6e 64 69 73 |lskii an|d Landis|
|00005090| 29 2e 0a 0a 54 68 65 20 | 64 61 74 61 20 73 74 72 |)...The |data str|
|000050a0| 75 63 74 75 72 65 20 6f | 66 20 61 20 74 72 65 65 |ucture o|f a tree|
|000050b0| 20 69 73 20 73 69 6d 70 | 6c 65 20 2d 20 69 74 20 | is simp|le - it |
|000050c0| 69 73 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 61 |is essen|tially a|
|000050d0| 20 3c 6c 69 6e 6b 65 64 | 20 6c 69 73 74 3d 3e 4c | <linked| list=>L|
|000050e0| 69 73 74 73 3e 20 77 68 | 65 72 65 20 65 61 63 68 |ists> wh|ere each|
|000050f0| 20 6e 6f 64 65 20 6d 61 | 79 20 68 61 76 65 20 6d | node ma|y have m|
|00005100| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 73 75 63 |ore than| one suc|
|00005110| 63 65 73 73 6f 72 2e 20 | 4f 72 20 74 6f 20 70 75 |cessor. |Or to pu|
|00005120| 74 20 69 6e 20 61 6e 6f | 74 68 65 72 20 77 61 79 |t in ano|ther way|
|00005130| 2c 20 61 20 6c 69 73 74 | 20 69 73 20 61 6e 20 65 |, a list| is an e|
|00005140| 78 61 6d 70 6c 65 20 6f | 66 20 61 20 75 6e 61 72 |xample o|f a unar|
|00005150| 79 20 74 72 65 65 2e 20 | 41 20 74 72 65 65 20 77 |y tree. |A tree w|
|00005160| 68 69 63 68 20 68 61 73 | 20 61 20 6c 69 6d 69 74 |hich has| a limit|
|00005170| 20 74 6f 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f | to the |number o|
|00005180| 66 20 73 75 63 63 65 73 | 73 6f 72 73 20 6f 66 20 |f succes|sors of |
|00005190| 61 6e 79 20 6e 6f 64 65 | 20 6f 66 20 6b 20 69 73 |any node| of k is|
|000051a0| 20 6b 6e 6f 77 6e 20 61 | 73 20 61 20 7b 2a 7d 6b | known a|s a {*}k|
|000051b0| 2d 61 72 79 7b 2a 7d 20 | 74 72 65 65 2e 20 20 43 |-ary{*} |tree. C|
|000051c0| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 6c 79 20 61 |orrespon|dingly a|
|000051d0| 20 62 69 6e 61 72 79 20 | 74 72 65 65 2c 20 77 68 | binary |tree, wh|
|000051e0| 69 63 68 20 69 73 20 61 | 20 76 65 72 79 20 63 6f |ich is a| very co|
|000051f0| 6d 6d 6f 6e 6c 79 20 75 | 73 65 64 20 73 74 72 75 |mmonly u|sed stru|
|00005200| 63 74 75 72 65 2c 20 68 | 61 73 20 6f 6e 6c 79 20 |cture, h|as only |
|00005210| 74 77 6f 20 6f 72 20 66 | 65 77 65 72 20 73 75 63 |two or f|ewer suc|
|00005220| 63 65 73 73 6f 72 73 20 | 74 6f 20 65 61 63 68 20 |cessors |to each |
|00005230| 6e 6f 64 65 2e 0a 0a 23 | 66 48 34 3a 54 72 65 65 |node...#|fH4:Tree|
|00005240| 20 54 72 61 76 65 72 73 | 61 6c 0a 54 72 65 65 73 | Travers|al.Trees|
|00005250| 20 6d 61 79 20 62 65 20 | 74 72 61 76 65 72 73 65 | may be |traverse|
|00005260| 64 20 7b 2a 7d 70 72 65 | 6f 72 64 65 72 7b 2a 7d |d {*}pre|order{*}|
|00005270| 2c 20 7b 2a 7d 69 6e 6f | 72 64 65 72 7b 2a 7d 2c |, {*}ino|rder{*},|
|00005280| 20 6f 72 20 7b 2a 7d 70 | 6f 73 74 6f 72 64 65 72 | or {*}p|ostorder|
|00005290| 7b 2a 7d 2e 0a 0a 7b 2a | 7d 50 72 65 6f 72 64 65 |{*}...{*|}Preorde|
|000052a0| 72 20 74 72 61 76 65 72 | 73 61 6c 7b 2a 7d 0a 41 |r traver|sal{*}.A|
|000052b0| 63 63 65 73 73 20 61 6e | 64 20 70 72 6f 63 65 73 |ccess an|d proces|
|000052c0| 73 20 72 6f 6f 74 0a 50 | 72 65 6f 72 64 65 72 20 |s root.P|reorder |
|000052d0| 74 72 61 76 65 72 73 65 | 20 73 75 62 74 72 65 65 |traverse| subtree|
|000052e0| 73 20 69 6e 20 6f 72 64 | 65 72 0a 0a 7b 2a 7d 49 |s in ord|er..{*}I|
|000052f0| 6e 6f 72 64 65 72 20 74 | 72 61 76 65 72 73 61 6c |norder t|raversal|
|00005300| 20 2d 20 62 69 6e 61 72 | 79 20 74 72 65 65 73 20 | - binar|y trees |
|00005310| 6f 6e 6c 79 7b 2a 7d 0a | 49 6e 6f 72 64 65 72 20 |only{*}.|Inorder |
|00005320| 74 72 61 76 65 72 73 65 | 20 6c 65 66 74 20 73 75 |traverse| left su|
|00005330| 62 74 72 65 65 0a 41 63 | 65 73 73 20 61 6e 64 20 |btree.Ac|ess and |
|00005340| 70 72 6f 63 65 73 73 20 | 72 6f 6f 74 0a 49 6e 6f |process |root.Ino|
|00005350| 72 64 65 72 20 74 72 61 | 76 65 72 73 65 20 72 69 |rder tra|verse ri|
|00005360| 67 68 74 20 73 75 62 74 | 72 65 65 0a 0a 7b 2a 7d |ght subt|ree..{*}|
|00005370| 50 6f 73 74 6f 72 64 65 | 72 20 74 72 61 76 65 72 |Postorde|r traver|
|00005380| 73 61 6c 7b 2a 7d 0a 50 | 6f 73 74 6f 72 64 65 72 |sal{*}.P|ostorder|
|00005390| 20 74 72 61 76 65 72 73 | 65 20 73 75 62 74 72 65 | travers|e subtre|
|000053a0| 65 73 20 69 6e 20 6f 72 | 64 65 72 0a 41 63 63 65 |es in or|der.Acce|
|000053b0| 73 73 20 61 6e 64 20 70 | 72 6f 63 65 73 73 20 72 |ss and p|rocess r|
|000053c0| 6f 6f 74 0a 0a 00 00 00 | 44 41 54 41 b6 06 00 00 |oot.....|DATA....|
|000053d0| 56 69 72 74 75 61 6c 20 | 46 75 6e 63 74 69 6f 6e |Virtual |Function|
|000053e0| 73 0a 56 69 72 74 75 61 | 6c 20 66 75 6e 63 74 69 |s.Virtua|l functi|
|000053f0| 6f 6e 73 20 61 72 65 20 | 69 6e 74 65 72 65 73 74 |ons are |interest|
|00005400| 69 6e 67 20 62 65 61 73 | 74 73 2c 20 61 6e 64 20 |ing beas|ts, and |
|00005410| 63 61 75 73 65 20 61 20 | 4c 4f 54 20 6f 66 20 70 |cause a |LOT of p|
|00005420| 72 6f 62 6c 65 6d 73 2e | 20 48 65 72 65 20 61 72 |roblems.| Here ar|
|00005430| 65 20 61 20 66 65 77 20 | 69 6e 74 65 72 65 73 74 |e a few |interest|
|00005440| 69 6e 67 20 70 6f 69 6e | 74 73 20 6f 72 20 77 61 |ing poin|ts or wa|
|00005450| 72 6e 69 6e 67 73 2e 0a | 0a 3c 50 75 72 65 20 76 |rnings..|.<Pure v|
|00005460| 69 72 74 75 61 6c 20 66 | 75 6e 63 74 69 6f 6e 73 |irtual f|unctions|
|00005470| 3d 3e 2e 50 75 72 65 56 | 69 72 74 75 61 6c 3e 0a |=>.PureV|irtual>.|
|00005480| 3c 56 69 72 74 75 61 6c | 20 74 61 62 6c 65 20 6e |<Virtual| table n|
|00005490| 6f 74 20 61 63 63 65 73 | 73 69 62 6c 65 20 66 72 |ot acces|sible fr|
|000054a0| 6f 6d 20 62 61 73 65 20 | 63 6c 61 73 73 20 64 74 |om base |class dt|
|000054b0| 6f 72 3d 3e 2e 64 74 6f | 72 3e 0a 23 0a 23 53 75 |or=>.dto|r>.#.#Su|
|000054c0| 62 70 61 67 65 20 50 75 | 72 65 56 69 72 74 75 61 |bpage Pu|reVirtua|
|000054d0| 6c 0a 50 75 72 65 20 56 | 69 72 74 75 61 6c 0a 41 |l.Pure V|irtual.A|
|000054e0| 20 70 75 72 65 20 76 69 | 72 74 75 61 6c 20 66 75 | pure vi|rtual fu|
|000054f0| 6e 63 74 69 6f 6e 20 64 | 65 63 6c 61 72 65 73 20 |nction d|eclares |
|00005500| 61 6e 20 65 6d 70 74 79 | 20 66 75 6e 63 74 69 6f |an empty| functio|
|00005510| 6e 2e 20 41 20 63 6c 61 | 73 73 20 63 6f 6e 74 61 |n. A cla|ss conta|
|00005520| 69 6e 69 6e 67 20 61 20 | 70 75 72 65 20 76 69 72 |ining a |pure vir|
|00005530| 74 75 61 6c 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |tual fun|ction ca|
|00005540| 6e 6e 6f 74 20 62 65 20 | 69 6e 73 74 61 6e 74 69 |nnot be |instanti|
|00005550| 61 74 65 64 2c 20 61 6e | 64 20 69 73 20 6b 6e 6f |ated, an|d is kno|
|00005560| 77 6e 20 61 73 20 61 6e | 20 7b 2a 7d 61 62 73 74 |wn as an| {*}abst|
|00005570| 72 61 63 74 20 63 6c 61 | 73 73 7b 2a 7d 2e 0a 0a |ract cla|ss{*}...|
|00005580| 41 6e 79 20 64 65 72 69 | 76 65 64 20 63 6c 61 73 |Any deri|ved clas|
|00005590| 73 20 6d 75 73 74 20 64 | 65 66 69 6e 65 20 61 20 |s must d|efine a |
|000055a0| 62 6f 64 79 20 66 6f 72 | 20 74 68 65 20 66 75 6e |body for| the fun|
|000055b0| 63 74 69 6f 6e 2c 20 6f | 72 20 69 74 20 74 6f 6f |ction, o|r it too|
|000055c0| 20 69 73 20 61 6e 20 61 | 62 73 74 72 61 63 74 20 | is an a|bstract |
|000055d0| 63 6c 61 73 73 2e 20 53 | 69 6e 63 65 20 76 69 72 |class. S|ince vir|
|000055e0| 74 75 61 6c 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |tual fun|ction ca|
|000055f0| 6c 6c 73 20 61 72 65 20 | 62 6f 75 6e 64 20 61 74 |lls are |bound at|
|00005600| 20 72 75 6e 2d 74 69 6d | 65 2c 20 69 74 20 69 73 | run-tim|e, it is|
|00005610| 20 65 6e 74 69 72 65 6c | 79 20 70 6f 73 73 69 62 | entirel|y possib|
|00005620| 6c 65 20 74 6f 20 63 61 | 6c 6c 20 61 20 70 75 72 |le to ca|ll a pur|
|00005630| 65 20 76 69 72 74 75 61 | 6c 20 66 75 6e 63 74 69 |e virtua|l functi|
|00005640| 6f 6e 2e 20 54 68 65 20 | 65 66 66 65 63 74 20 6f |on. The |effect o|
|00005650| 66 20 63 61 6c 6c 69 6e | 67 20 61 20 70 75 72 65 |f callin|g a pure|
|00005660| 20 76 69 72 74 75 61 6c | 20 69 73 20 75 6e 64 65 | virtual| is unde|
|00005670| 66 69 6e 65 64 2e 20 4f | 6e 20 41 63 6f 72 6e 20 |fined. O|n Acorn |
|00005680| 43 2f 43 2b 2b 20 64 6f | 69 6e 67 20 73 6f 20 64 |C/C++ do|ing so d|
|00005690| 69 72 65 63 74 6c 79 20 | 72 65 73 75 6c 74 73 20 |irectly |results |
|000056a0| 69 6e 20 61 20 6c 69 6e | 6b 65 72 20 65 72 72 6f |in a lin|ker erro|
|000056b0| 72 2e 20 4f 62 76 69 6f | 75 73 6c 79 20 74 68 65 |r. Obvio|usly the|
|000056c0| 20 63 6f 6d 70 69 6c 65 | 72 20 6f 72 20 6c 69 6e | compile|r or lin|
|000056d0| 6b 65 72 20 63 61 6e 6e | 6f 74 20 64 65 74 65 63 |ker cann|ot detec|
|000056e0| 74 20 61 6e 20 69 6e 64 | 69 72 65 63 74 20 63 61 |t an ind|irect ca|
|000056f0| 6c 6c 2e 20 0a 0a 23 0a | 23 53 75 62 70 61 67 65 |ll. ..#.|#Subpage|
|00005700| 20 64 74 6f 72 0a 56 69 | 72 74 75 61 6c 20 54 61 | dtor.Vi|rtual Ta|
|00005710| 62 6c 65 20 44 65 73 74 | 72 75 63 74 69 6f 6e 0a |ble Dest|ruction.|
|00005720| 49 66 20 79 6f 75 20 68 | 61 76 65 20 74 68 65 20 |If you h|ave the |
|00005730| 66 6f 6c 6c 6f 77 69 6e | 67 20 63 6f 64 65 0a 0a |followin|g code..|
|00005740| 63 6c 61 73 73 20 49 63 | 6f 6e 53 74 6f 72 65 3b |class Ic|onStore;|
|00005750| 0a 63 6c 61 73 73 20 41 | 0a 7b 0a 70 72 69 76 61 |.class A|.{.priva|
|00005760| 74 65 3a 0a 20 20 20 49 | 63 6f 6e 53 74 6f 72 65 |te:. I|conStore|
|00005770| 2a 20 61 5f 70 61 72 65 | 6e 74 3b 0a 70 75 62 6c |* a_pare|nt;.publ|
|00005780| 69 63 3a 0a 20 20 20 41 | 28 49 63 6f 6e 53 74 6f |ic:. A|(IconSto|
|00005790| 72 65 2a 20 70 61 72 65 | 6e 74 29 0a 20 20 20 5c |re* pare|nt). \|
|000057a0| 7b 20 61 5f 70 61 72 65 | 6e 74 20 3d 20 70 61 72 |{ a_pare|nt = par|
|000057b0| 65 6e 74 3b 7d 0a 20 20 | 20 7e 41 28 76 6f 69 64 |ent;}. | ~A(void|
|000057c0| 29 0a 20 20 20 7b 0a 20 | 20 20 20 20 20 61 5f 70 |). {. | a_p|
|000057d0| 61 72 65 6e 74 2d 3e 47 | 65 74 48 61 6e 64 6c 65 |arent->G|etHandle|
|000057e0| 28 29 3b 0a 20 20 20 7d | 0a 7d 0a 0a 63 6c 61 73 |();. }|.}..clas|
|000057f0| 73 20 49 63 6f 6e 53 74 | 6f 72 65 0a 7b 0a 70 72 |s IconSt|ore.{.pr|
|00005800| 6f 74 65 63 74 65 64 3a | 0a 20 20 20 41 2a 20 20 |otected:|. A* |
|00005810| 20 20 20 20 20 20 20 61 | 5f 6f 62 6a 65 63 74 3b | a|_object;|
|00005820| 0a 70 75 62 6c 69 63 3a | 0a 20 20 20 76 69 72 74 |.public:|. virt|
|00005830| 75 61 6c 20 20 20 20 20 | 7e 49 63 6f 6e 53 74 6f |ual |~IconSto|
|00005840| 72 65 28 76 6f 69 64 29 | 0a 20 20 20 7b 0a 20 20 |re(void)|. {. |
|00005850| 20 20 20 20 64 65 6c 65 | 74 65 20 61 5f 6f 62 6a | dele|te a_obj|
|00005860| 65 63 74 3b 0a 20 20 20 | 7d 0a 20 20 20 76 69 72 |ect;. |}. vir|
|00005870| 74 75 61 6c 20 69 6e 74 | 20 47 65 74 48 61 6e 64 |tual int| GetHand|
|00005880| 6c 65 28 76 6f 69 64 29 | 20 63 6f 6e 73 74 20 3d |le(void)| const =|
|00005890| 20 30 3b 0a 7d 3b 0a 0a | 63 6c 61 73 73 20 49 63 | 0;.};..|class Ic|
|000058a0| 6f 6e 42 61 72 20 3a 20 | 70 75 62 6c 69 63 20 49 |onBar : |public I|
|000058b0| 63 6f 6e 53 74 6f 72 65 | 0a 7b 0a 70 75 62 6c 69 |conStore|.{.publi|
|000058c0| 63 3a 0a 20 20 20 49 63 | 6f 6e 42 61 72 28 76 6f |c:. Ic|onBar(vo|
|000058d0| 69 64 29 20 5c 7b 20 61 | 5f 6f 62 6a 65 63 74 20 |id) \{ a|_object |
|000058e0| 3d 20 6e 65 77 20 41 28 | 74 68 69 73 29 3b 7d 0a |= new A(|this);}.|
|000058f0| 20 20 20 76 69 72 74 75 | 61 6c 20 7e 49 63 6f 6e | virtu|al ~Icon|
|00005900| 42 61 72 28 76 6f 69 64 | 29 20 5c 7b 7d 0a 20 20 |Bar(void|) \{}. |
|00005910| 20 76 69 72 74 75 61 6c | 20 69 6e 74 20 47 65 74 | virtual| int Get|
|00005920| 48 61 6e 64 6c 65 28 76 | 6f 69 64 29 20 7b 20 72 |Handle(v|oid) { r|
|00005930| 65 74 75 72 6e 20 30 3b | 20 7d 0a 7d 3b 0a 0a 0a |eturn 0;| }.};...|
|00005940| 54 68 65 6e 20 77 68 65 | 6e 20 49 63 6f 6e 42 61 |Then whe|n IconBa|
|00005950| 72 20 69 73 20 64 65 73 | 74 72 75 63 74 65 64 2c |r is des|tructed,|
|00005960| 20 41 20 69 73 20 64 65 | 73 74 72 75 63 74 65 64 | A is de|structed|
|00005970| 2c 20 62 75 74 20 66 72 | 6f 6d 20 77 69 74 68 69 |, but fr|om withi|
|00005980| 6e 20 49 63 6f 6e 53 74 | 6f 72 65 2e 0a 43 6f 6e |n IconSt|ore..Con|
|00005990| 73 65 71 75 65 6e 74 6c | 79 2c 20 61 6c 74 68 6f |sequentl|y, altho|
|000059a0| 75 67 68 20 41 20 68 61 | 73 20 61 20 70 61 72 65 |ugh A ha|s a pare|
|000059b0| 6e 74 20 6f 66 20 74 79 | 70 65 20 49 63 6f 6e 42 |nt of ty|pe IconB|
|000059c0| 61 72 2c 20 74 68 65 20 | 76 69 72 74 75 61 6c 20 |ar, the |virtual |
|000059d0| 74 61 62 6c 65 20 66 6f | 72 0a 49 63 6f 6e 42 61 |table fo|r.IconBa|
|000059e0| 72 20 6e 6f 20 6c 6f 6e | 67 65 72 20 65 78 69 73 |r no lon|ger exis|
|000059f0| 74 73 2c 20 61 6e 64 20 | 73 6f 20 49 63 6f 6e 53 |ts, and |so IconS|
|00005a00| 74 6f 72 65 3a 3a 47 65 | 74 48 61 6e 64 6c 65 20 |tore::Ge|tHandle |
|00005a10| 69 73 20 63 61 6c 6c 65 | 64 20 2d 20 77 68 69 63 |is calle|d - whic|
|00005a20| 68 20 69 73 0a 6f 62 76 | 69 6f 75 73 6c 79 20 77 |h is.obv|iously w|
|00005a30| 72 6f 6e 67 2c 20 61 6e | 64 20 69 6e 20 74 68 69 |rong, an|d in thi|
|00005a40| 73 20 63 61 73 65 20 63 | 61 75 73 65 73 20 61 6e |s case c|auses an|
|00005a50| 20 69 6d 6d 65 64 69 61 | 74 65 20 63 72 61 73 68 | immedia|te crash|
|00005a60| 2c 20 61 73 20 69 74 20 | 69 73 20 61 20 70 75 72 |, as it |is a pur|
|00005a70| 65 20 76 69 72 74 75 61 | 6c 2e 0a 0a 0a 0a 00 00 |e virtua|l.......|
|00005a80| 44 41 54 41 8e 01 00 00 | 76 6f 6c 61 74 69 6c 65 |DATA....|volatile|
|00005a90| 0a 56 6f 6c 61 74 69 6c | 65 20 69 73 20 76 65 72 |.Volatil|e is ver|
|00005aa0| 79 20 6d 75 63 68 20 74 | 68 65 20 6f 70 70 6f 73 |y much t|he oppos|
|00005ab0| 69 74 65 20 6f 66 20 63 | 6f 6e 73 74 2e 20 49 74 |ite of c|onst. It|
|00005ac0| 20 73 61 79 73 20 74 68 | 61 74 0a 74 68 65 20 76 | says th|at.the v|
|00005ad0| 61 6c 75 65 20 6f 66 20 | 61 20 76 61 72 69 61 62 |alue of |a variab|
|00005ae0| 6c 65 20 6d 61 79 20 62 | 65 20 63 68 61 6e 67 65 |le may b|e change|
|00005af0| 20 61 74 20 61 6e 79 20 | 74 69 6d 65 2c 20 77 69 | at any |time, wi|
|00005b00| 74 68 6f 75 74 0a 74 68 | 65 20 63 6f 6d 70 69 6c |thout.th|e compil|
|00005b10| 65 72 73 20 6b 6e 6f 77 | 6c 65 64 67 65 2e 20 53 |ers know|ledge. S|
|00005b20| 6f 2c 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0a |o, for e|xample:.|
|00005b30| 0a 23 66 43 6f 64 65 0a | 76 6f 6c 61 74 69 6c 65 |.#fCode.|volatile|
|00005b40| 20 69 6e 74 20 69 20 3d | 20 30 3b 0a 69 6e 74 09 | int i =| 0;.int.|
|00005b50| 6e 6f 72 6d 61 6c 3b 0a | 73 65 74 5f 75 70 5f 64 |normal;.|set_up_d|
|00005b60| 6d 61 5f 73 74 75 66 66 | 28 26 69 29 3b 0a 6e 6f |ma_stuff|(&i);.no|
|00005b70| 72 6d 61 6c 20 3d 20 69 | 3b 0a 63 6f 75 74 20 3c |rmal = i|;.cout <|
|00005b80| 3c 20 6e 6f 72 6d 61 6c | 3b 0a 6e 6f 72 6d 61 6c |< normal|;.normal|
|00005b90| 20 3d 20 69 3b 20 20 20 | 20 2f 2f 20 69 20 69 73 | = i; | // i is|
|00005ba0| 20 76 6f 6c 61 74 69 6c | 65 2c 20 73 6f 20 74 68 | volatil|e, so th|
|00005bb0| 69 73 20 6c 69 6e 65 20 | 69 73 20 6e 6f 74 20 6f |is line |is not o|
|00005bc0| 70 74 69 6d 69 73 65 64 | 20 6f 75 74 0a 63 6f 75 |ptimised| out.cou|
|00005bd0| 74 20 3c 3c 20 6e 6f 72 | 6d 61 6c 3b 0a 23 66 53 |t << nor|mal;.#fS|
|00005be0| 74 64 0a 0a 49 74 20 69 | 73 20 6e 6f 72 6d 61 6c |td..It i|s normal|
|00005bf0| 6c 79 20 75 73 65 64 20 | 66 6f 72 20 6d 65 6d 6f |ly used |for memo|
|00005c00| 72 79 20 6d 61 70 70 65 | 64 20 69 2f 6f 2e 00 00 |ry mappe|d i/o...|
|00005c10| 44 41 54 41 70 03 00 00 | 54 79 70 65 73 0a 43 2b |DATAp...|Types.C+|
|00005c20| 2b 20 68 61 73 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |+ has th|e follow|
|00005c30| 69 6e 67 20 62 75 69 6c | 74 20 69 6e 20 74 79 70 |ing buil|t in typ|
|00005c40| 65 73 3a 0a 0a 63 68 61 | 72 2c 20 69 6e 74 2c 20 |es:..cha|r, int, |
|00005c50| 66 6c 6f 61 74 2c 20 64 | 6f 75 62 6c 65 2c 76 6f |float, d|ouble,vo|
|00005c60| 69 64 0a 61 20 63 68 61 | 72 20 6d 61 79 20 62 65 |id.a cha|r may be|
|00005c70| 20 73 69 67 6e 65 64 2c | 20 75 6e 73 69 67 6e 65 | signed,| unsigne|
|00005c80| 64 2c 20 6f 72 20 70 6c | 61 69 6e 0a 61 6e 20 69 |d, or pl|ain.an i|
|00005c90| 6e 74 20 6d 61 79 20 62 | 65 20 73 69 67 6e 65 64 |nt may b|e signed|
|00005ca0| 20 6f 72 20 75 6e 73 69 | 67 6e 65 64 2c 20 61 6e | or unsi|gned, an|
|00005cb0| 64 20 61 6c 73 6f 20 6c | 6f 6e 67 2c 20 73 68 6f |d also l|ong, sho|
|00005cc0| 72 74 2c 20 6f 72 20 70 | 6c 61 69 6e 0a 61 20 64 |rt, or p|lain.a d|
|00005cd0| 6f 75 62 6c 65 20 6d 61 | 79 20 62 65 20 6c 6f 6e |ouble ma|y be lon|
|00005ce0| 67 2c 20 6f 72 20 70 6c | 61 69 6e 0a 0a 63 68 61 |g, or pl|ain..cha|
|00005cf0| 72 20 61 6e 64 20 69 6e | 74 20 61 72 65 20 75 73 |r and in|t are us|
|00005d00| 65 64 20 66 6f 72 20 69 | 6e 74 65 67 65 72 20 74 |ed for i|nteger t|
|00005d10| 79 70 65 73 0a 66 6c 6f | 61 74 20 61 6e 64 20 64 |ypes.flo|at and d|
|00005d20| 6f 75 62 6c 65 20 61 72 | 65 20 75 73 65 64 20 66 |ouble ar|e used f|
|00005d30| 6f 72 20 72 65 61 6c 20 | 74 79 70 65 73 0a 76 6f |or real |types.vo|
|00005d40| 69 64 20 69 73 20 61 6e | 20 65 6d 70 74 79 20 74 |id is an| empty t|
|00005d50| 79 70 65 2c 20 61 6e 64 | 20 69 73 20 75 73 65 64 |ype, and| is used|
|00005d60| 20 74 6f 20 69 6e 64 69 | 63 61 74 65 20 61 6e 20 | to indi|cate an |
|00005d70| 61 62 73 65 6e 63 65 20 | 6f 66 0a 70 61 72 61 6d |absence |of.param|
|00005d80| 74 65 72 73 20 2d 20 65 | 67 0a 0a 23 66 43 6f 64 |ters - e|g..#fCod|
|00005d90| 65 0a 09 2f 2f 52 65 63 | 65 69 76 65 20 6e 6f 74 |e..//Rec|eive not|
|00005da0| 68 69 6e 67 2c 20 61 6e | 64 20 72 65 74 75 72 6e |hing, an|d return|
|00005db0| 20 6e 6f 74 68 69 6e 67 | 0a 09 76 6f 69 64 20 66 | nothing|..void f|
|00005dc0| 75 6e 63 74 69 6f 6e 28 | 76 6f 69 64 29 3b 0a 23 |unction(|void);.#|
|00005dd0| 66 53 74 64 0a 0a 41 20 | 70 6f 69 6e 74 65 72 20 |fStd..A |pointer |
|00005de0| 74 6f 20 61 20 76 6f 69 | 64 20 69 73 20 75 73 65 |to a voi|d is use|
|00005df0| 64 20 77 68 65 72 65 20 | 74 68 65 20 74 79 70 65 |d where |the type|
|00005e00| 20 6f 66 20 61 6e 20 6f | 62 6a 65 63 74 20 69 73 | of an o|bject is|
|00005e10| 20 6e 6f 74 20 6b 6e 6f | 77 6e 2c 20 61 6e 64 0a | not kno|wn, and.|
|00005e20| 61 62 73 6f 6c 76 65 73 | 20 74 68 65 20 63 6f 6d |absolves| the com|
|00005e30| 70 69 6c 65 72 20 6f 66 | 20 61 6e 79 20 72 65 73 |piler of| any res|
|00005e40| 70 6f 6e 73 69 62 69 6c | 69 74 79 20 66 6f 72 20 |ponsibil|ity for |
|00005e50| 74 79 70 65 20 63 68 65 | 63 6b 69 6e 67 2e 20 54 |type che|cking. T|
|00005e60| 65 6d 70 6c 61 74 65 73 | 0a 70 72 6f 76 69 64 65 |emplates|.provide|
|00005e70| 20 61 6e 6f 74 68 65 72 | 20 73 6f 6c 75 74 69 6f | another| solutio|
|00005e80| 6e 20 74 6f 20 74 68 69 | 73 20 70 72 6f 62 6c 65 |n to thi|s proble|
|00005e90| 6d 2e 0a 0a 0a 4f 6e 20 | 74 68 65 20 41 63 6f 72 |m....On |the Acor|
|00005ea0| 6e 20 70 6c 61 74 66 6f | 72 6d 3a 0a 0a 61 20 63 |n platfo|rm:..a c|
|00005eb0| 68 61 72 20 69 73 20 38 | 20 62 69 74 73 2c 20 61 |har is 8| bits, a|
|00005ec0| 6e 64 20 49 20 62 65 6c | 69 65 76 65 20 61 20 70 |nd I bel|ieve a p|
|00005ed0| 6c 61 69 6e 20 63 68 61 | 72 20 69 73 20 75 6e 73 |lain cha|r is uns|
|00005ee0| 69 67 6e 65 64 0a 61 6e | 20 69 6e 74 20 69 73 20 |igned.an| int is |
|00005ef0| 33 32 20 62 69 74 73 2c | 20 61 73 20 69 73 20 61 |32 bits,| as is a|
|00005f00| 20 73 68 6f 72 74 2e 0a | 66 6c 6f 61 74 73 20 61 | short..|floats a|
|00005f10| 72 65 20 69 6e 74 65 72 | 65 73 74 69 6e 67 20 62 |re inter|esting b|
|00005f20| 65 61 73 74 73 2c 20 61 | 6e 64 20 79 6f 75 20 61 |easts, a|nd you a|
|00005f30| 72 65 20 61 64 76 69 73 | 65 64 20 74 6f 20 6c 6f |re advis|ed to lo|
|00005f40| 6f 6b 20 61 74 20 74 68 | 65 20 46 50 0a 61 73 73 |ok at th|e FP.ass|
|00005f50| 65 6d 62 6c 65 72 20 73 | 74 61 74 65 6d 65 6e 74 |embler s|tatement|
|00005f60| 20 61 72 65 20 64 72 61 | 77 20 79 6f 75 72 20 6f | are dra|w your o|
|00005f70| 77 6e 20 63 6f 6e 63 6c | 75 73 69 6f 6e 73 2e 0a |wn concl|usions..|
+--------+-------------------------+-------------------------+--------+--------+